|
.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) | |
| EngineResults | response (SXNG_Response resp) |
Variables | |
| list | categories = ['general'] |
| bool | paging = True |
| dict | about |
| str | base_url = 'http://localhost:9200' |
| str | username = '' |
| str | password = '' |
| str | index = '' |
| str | query_type = 'match' |
| dict | custom_query_json = {} |
| bool | show_metadata = False |
| int | page_size = 10 |
| 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: els
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 156 of file elasticsearch.py.
|
protected |
The standard for full text queries. SearXNG 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 101 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 116 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 126 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 141 of file elasticsearch.py.
| searx.engines.elasticsearch.init | ( | engine_settings | ) |
Definition at line 71 of file elasticsearch.py.
| searx.engines.elasticsearch.request | ( | query, | |
| params ) |
Definition at line 79 of file elasticsearch.py.
| EngineResults searx.engines.elasticsearch.response | ( | SXNG_Response | resp | ) |
Definition at line 167 of file elasticsearch.py.
|
protected |
Definition at line 183 of file elasticsearch.py.
| dict searx.engines.elasticsearch.about |
Definition at line 52 of file elasticsearch.py.
| str searx.engines.elasticsearch.base_url = 'http://localhost:9200' |
Definition at line 61 of file elasticsearch.py.
| list searx.engines.elasticsearch.categories = ['general'] |
Definition at line 49 of file elasticsearch.py.
| dict searx.engines.elasticsearch.custom_query_json = {} |
Definition at line 66 of file elasticsearch.py.
| str searx.engines.elasticsearch.index = '' |
Definition at line 64 of file elasticsearch.py.
| int searx.engines.elasticsearch.page_size = 10 |
Definition at line 68 of file elasticsearch.py.
| bool searx.engines.elasticsearch.paging = True |
Definition at line 50 of file elasticsearch.py.
| str searx.engines.elasticsearch.password = '' |
Definition at line 63 of file elasticsearch.py.
| str searx.engines.elasticsearch.query_type = 'match' |
Definition at line 65 of file elasticsearch.py.
| bool searx.engines.elasticsearch.show_metadata = False |
Definition at line 67 of file elasticsearch.py.
| str searx.engines.elasticsearch.username = '' |
Definition at line 62 of file elasticsearch.py.