def list_all_available_fields(**kwargs): """ List all available fields for all available buckets Variables: None Arguments: bucket => Which specific bucket you want to know the fields for full => True/False if you want system buckets to be included Default: False Data Block: None Result example: { "<<BUCKET_NAME>>": { # For a given bucket "<<FIELD_NAME>>": { # For a given field indexed: True, # Is the field indexed stored: False, # Is the field stored type: string # What type of data in the field }, ... }, ... } """ full = request.args.get('full', "False") full = (full.lower() == "true") bucket = request.args.get('bucket', None) return make_api_response(STORAGE.generate_field_list(full, specific_bucket=bucket))
def search_help(**kwargs): field_list = { k: sorted([(x, y) for x, y in v.iteritems()]) for k, v in STORAGE.generate_field_list(False).iteritems() } lookup = { "text_ws": "whitespace separated text", "text_ws_dsplit": "dot and whitespace separated text", "text_general": "tokenized text", "text_fuzzy": "separated fuzzy patterns", } return custom_render("search_help.html", field_list=field_list, lookup=lookup, **kwargs)