Search API¶
API operations searching information.
-
search.views.
get_facets
()[source]¶ - GET /get_facets/?name={name}&q={query}
- Return all facets for a given field name and a search query.
Parameters: - name – facet field name
- q – search query
Returns: list of facet items for the given field
Return type: JSON response
-
search.views.
get_facets_list
()[source]¶ - GET /get_facets_list/
- Get the list of facet fields.
Returns: list of all facet fields Return type: JSON response
-
search.views.
process_user_input
(query)[source]¶ Process the user input by stripping extra whitespaces, ensuring prefix search by appending asterisks to each search term, and escaping commas and semicolons.
Parameters: query – search query Returns: processed query Return type: string Doctests:
>>> process_user_input('') ''
>>> process_user_input('antonio vivaldi') 'antonio* vivaldi*'
>>> process_user_input('vivaldi, antonio') 'vivaldi","* antonio*'
>>> process_user_input('The . Beatles$') 'The*.Beatles$'
>>> process_user_input(':facet:Preis:* :facet:Preis:2.40') ':facet:Preis:* :facet:Preis:"2.40"'
>>> process_user_input('magic :facet:Preis:* :facet:Preis:2.40') ':facet:Preis:* :facet:Preis:"2.40" magic*'
>>> process_user_input('ge :facet:Autor:* mo* vi$ | fr | neur.netw') ':facet:Autor:* ge* mo* vi$|fr*|neur*.netw*'
>>> process_user_input('mo| fr | ge .tu') 'mo*|fr*|ge*.tu*'
-
search.views.
search
()[source]¶ - GET /search/?q={query}&start={start}&hits_per_page={hits_per_page}
- Perform search using CompleteSearch.
Parameters: - q – search query
- start – send hits starting from this one
- hits_per_page – how many hits return per page
Returns: list of search hits
Return type: JSON response