You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oren Mishali edited this page Oct 26, 2020
·
1 revision
Elasticsearch (ES)
To use ES we first need to install and execute it. Then we will use a python library (actually two libraries) to communicate with the ES server.
Install ES
You may use an installer, but we prefer the ZIP installation. Basically you need to unzip, open a Bash shell (available from 'Git for Windows'), and execute the server using the command:
./bin/elasticsearch.bat
The ES server listens on port 9200. See in the guide how to check that it is running.
Python API
Basically, the communication with the ES server is via REST HTTP requests. It is more convenient to use a higher-level API, e.g., a Python API. There is a low-level python API, and there is another API that is more friendly to use in some cases.
Low-level API: search 'python elasticsearch'
High-level API: search 'python elasticsearch dsl'
Example usage
We used ES (and the python APIs) to develop a search engine for the Jewish bookshelf. You may browse the (Flask) code to see how we used it in the backend side. Search for a backend/ap.py file in the 'jbse' repository.