.oO SearXNG Developer Documentation Oo.
|
Functions | |
init (engine_settings) | |
request (query, params) | |
_match_query (query) | |
_simple_query_string_query (query) | |
_term_query (query) | |
_terms_query (query) | |
_custom_query (query) | |
response (resp) | |
Variables | |
str | base_url = 'http://localhost:9200' |
str | username = '' |
str | password = '' |
str | index = '' |
str | search_url = '{base_url}/{index}/_search' |
str | query_type = 'match' |
dict | custom_query_json = {} |
bool | show_metadata = False |
list | categories = ['general'] |
dict | _available_query_types |
.. sidebar:: info - :origin:`elasticsearch.py <searx/engines/elasticsearch.py>` - `Elasticsearch <https://www.elastic.co/elasticsearch/>`_ - `Elasticsearch Guide <https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html>`_ - `Install Elasticsearch <https://www.elastic.co/guide/en/elasticsearch/reference/current/install-elasticsearch.html>`_ Elasticsearch_ supports numerous ways to query the data it is storing. At the moment the engine supports the most popular search methods (``query_type``): - ``match``, - ``simple_query_string``, - ``term`` and - ``terms``. If none of the methods fit your use case, you can select ``custom`` query type and provide the JSON payload to submit to Elasticsearch in ``custom_query_json``. Example ======= The following is an example configuration for an Elasticsearch_ instance with authentication configured to read from ``my-index`` index. .. code:: yaml - name: elasticsearch shortcut: es engine: elasticsearch base_url: http://localhost:9200 username: elastic password: changeme index: my-index query_type: match # custom_query_json: '{ ... }' enable_http: true
|
protected |
Definition at line 137 of file elasticsearch.py.
|
protected |
The standard for full text queries. searx format: "key:value" e.g. city:berlin REF: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query.html
Definition at line 82 of file elasticsearch.py.
|
protected |
Accepts query strings, but it is less strict than query_string The field used can be specified in index.query.default_field in Elasticsearch. REF: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html
Definition at line 97 of file elasticsearch.py.
|
protected |
Accepts one term and the name of the field. searx format: "key:value" e.g. city:berlin REF: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html
Definition at line 107 of file elasticsearch.py.
|
protected |
Accepts multiple terms and the name of the field. searx format: "key:value1,value2" e.g. city:berlin,paris REF: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html
Definition at line 122 of file elasticsearch.py.
searx.engines.elasticsearch.init | ( | engine_settings | ) |
Definition at line 59 of file elasticsearch.py.
searx.engines.elasticsearch.request | ( | query, | |
params ) |
Definition at line 67 of file elasticsearch.py.
searx.engines.elasticsearch.response | ( | resp | ) |
Definition at line 148 of file elasticsearch.py.
|
protected |
Definition at line 167 of file elasticsearch.py.
str searx.engines.elasticsearch.base_url = 'http://localhost:9200' |
Definition at line 48 of file elasticsearch.py.
list searx.engines.elasticsearch.categories = ['general'] |
Definition at line 56 of file elasticsearch.py.
dict searx.engines.elasticsearch.custom_query_json = {} |
Definition at line 54 of file elasticsearch.py.
str searx.engines.elasticsearch.index = '' |
Definition at line 51 of file elasticsearch.py.
str searx.engines.elasticsearch.password = '' |
Definition at line 50 of file elasticsearch.py.
str searx.engines.elasticsearch.query_type = 'match' |
Definition at line 53 of file elasticsearch.py.
Definition at line 52 of file elasticsearch.py.
bool searx.engines.elasticsearch.show_metadata = False |
Definition at line 55 of file elasticsearch.py.
str searx.engines.elasticsearch.username = '' |
Definition at line 49 of file elasticsearch.py.