Good resources to learn ElasticSearch
Elasticsearch is an open-source distributed search engine based on Apache Lucene. It becomes more and more widely used as it can help us build scalable full text search applications easily. The core of elasticsearch is implemented in Java, but it provides an easy to use REST api that enables us to get access to Elasticsearch by using any programming language.
In this post, I shared some of the good blogs to learn elasticSearch.
ElasticSearch Tutorial for beginners
Basic ElasticSearch Concepts
This post describes some basic concepts of elasticSearch.
ElasticSearch is able to achieve fast search responses because, instead of searching the text directly, it searches an index instead.
In ElasticSearch, a Document is the unit of search and index.
An index consists of one or more Documents, and a Document consists of one or more Fields.
ElasticSearch in 5 minutes
This posts show you how easily to set up a elasticSearch service in just 5 minutes.
Another ElasticSearch tutorial to show how to install ElasticeSearch.
http://logz.io/blog/elasticsearch-tutorial/
Getting Started with ElasticSearch
Use examples to show how to install and use ElasticSearch.
How To Setup an Elasticsearch Cluster – Beginners Guide
This post explained all the steps to setup a three-node elasticsearch cluster
Use python to get access to elasticSearch
PYTHON + ELASTICSEARCH. FIRST STEPS.
This is a great post. There are detailed examples showing how to use python to create index and make a search using elasticSearch.
The first step is to install the python elasticsearch package.
pip install elasticsearch
# make sure ES is up and running
import requests
res = requests.get(‘http://localhost:9200’)
print(res.content)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#connect to our cluster from elasticsearch import Elasticsearch es = Elasticsearch([{'host': 'localhost', 'port': 9200}]) #index some test data es.index(index='test-index', doc_type='test', id=1, body={'test': 'test'}) es.index(index='sw', doc_type='people', id=1, body={ "name": "Luke Skywalker", "height": "172", "mass": "77", "hair_color": "blond", "birth_year": "19BBY", "gender": "male", }) #let's iterate over swapi people documents and index them import json r = requests.get('http://localhost:9200') i = 1 while r.status_code == 200: r = requests.get('http://swapi.co/api/people/'+ str(i)) es.index(index='sw', doc_type='people', id=i, body=json.loads(r.content)) i=i+1 print(i) |
More code can be accessed from here:
Having Fun: Python and Elasticsearch
https://bitquabit.com/post/having-fun-python-and-elasticsearch-part-1/
https://bitquabit.com/post/having-fun-python-and-elasticsearch-part-2/
https://bitquabit.com/post/having-fun-python-and-elasticsearch-part-3/
How To Use Elasticsearch With Python and Django
https://qbox.io/blog/series/elasticsearch-python-django-series
How to Query Elasticsearch with Python
https://elasticsearch-py.readthedocs.io/en/master
-
Shivank Agarwal