Answer the question
In order to leave comments, you need to log in
How to explicitly set the field type (keword) in Elasticsearch (python) when creating a document?
for i in rage(100):
body = {'title': 'The Title{}'.format(i), 'text': 'big big big text'}
result = es.index(index='index', doc_type='type', body=body)
Answer the question
In order to leave comments, you need to log in
You need to create a mapping - https://www.elastic.co/guide/en/elasticsearch/refe...
https://www.elastic.co/guide/en/elasticsearch/refe...
As already written, you need to make a mapping to your fields. In addition, you can also make fields for each field https://www.elastic.co/guide/en/elasticsearch/ref...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question