|
.oO SearXNG Developer Documentation Oo.
|
Functions | |
| init (_) | |
| connect () | |
| EngineResults | search (query, params) |
Variables | |
| str | engine_type = 'offline' |
| str | host = '127.0.0.1' |
| int | port = 27017 |
| str | username = '' |
| str | password = '' |
| database = None | |
| collection = None | |
| key = None | |
| bool | paging = True |
| int | results_per_page = 20 |
| bool | exact_match_only = False |
| _client = None | |
MongoDB_ is a document based database program that handles JSON like data.
Before configuring the ``mongodb`` engine, you must install the dependency
pymongo_.
Configuration
=============
In order to query MongoDB_, you have to select a ``database`` and a
``collection``. Furthermore, you have to select a ``key`` that is going to be
searched. MongoDB_ also supports the option ``exact_match_only``, so configure
it as you wish.
Example
=======
Below is an example configuration for using a MongoDB collection:
.. code:: yaml
# MongoDB engine
# Required dependency: pymongo
- name: mymongo
engine: mongodb
shortcut: md
exact_match_only: false
host: '127.0.0.1'
port: 27017
enable_http: true
results_per_page: 20
database: 'business'
collection: 'reviews' # name of the db collection
key: 'name' # key in the collection to search for
Implementations
===============
| searx.engines.mongodb.connect | ( | ) |
Definition at line 76 of file mongodb.py.
Referenced by init().
| searx.engines.mongodb.init | ( | _ | ) |
Definition at line 72 of file mongodb.py.
References connect().
| EngineResults searx.engines.mongodb.search | ( | query, | |
| params ) |
Definition at line 86 of file mongodb.py.
|
protected |
Definition at line 69 of file mongodb.py.
| searx.engines.mongodb.collection = None |
Definition at line 61 of file mongodb.py.
| searx.engines.mongodb.database = None |
Definition at line 60 of file mongodb.py.
| str searx.engines.mongodb.engine_type = 'offline' |
Definition at line 53 of file mongodb.py.
| bool searx.engines.mongodb.exact_match_only = False |
Definition at line 67 of file mongodb.py.
| str searx.engines.mongodb.host = '127.0.0.1' |
Definition at line 56 of file mongodb.py.
| searx.engines.mongodb.key = None |
Definition at line 62 of file mongodb.py.
| bool searx.engines.mongodb.paging = True |
Definition at line 65 of file mongodb.py.
| str searx.engines.mongodb.password = '' |
Definition at line 59 of file mongodb.py.
| int searx.engines.mongodb.port = 27017 |
Definition at line 57 of file mongodb.py.
| int searx.engines.mongodb.results_per_page = 20 |
Definition at line 66 of file mongodb.py.
| str searx.engines.mongodb.username = '' |
Definition at line 58 of file mongodb.py.