How can I apply analysers to a specific field in elasticsearch

I have a movies dataset and It has a field named as title ,now I want to set mappings with some search analysers,how can I do that Expecting successful search result >Solution : so first of all you have to set your mappings before inserting data with some analyzers, look at the image, we have… Read More How can I apply analysers to a specific field in elasticsearch

Elasticsearch How to count total docs by date

As my theme, I wanna count docs the day and before by date, it’s sample to understand that the chart. {"index":{"_index":"login-2015.12.23","_type":"logs"}} {"uid":"1","register_time":"2015-12-23T12:00:00Z","login_time":"2015-12-23T12:00:00Z"} {"index":{"_index":"login-2015.12.23","_type":"logs"}} {"uid":"2","register_time":"2015-12-23T12:00:00Z","login_time":"2015-12-23T12:00:00Z"} {"index":{"_index":"login-2015.12.24","_type":"logs"}} {"uid":"1","register_time":"2015-12-23T12:00:00Z","login_time":"2015-12-24T12:00:00Z"} {"index":{"_index":"login-2015.12.25","_type":"logs"}} {"uid":"1","register_time":"2015-12-23T12:00:00Z","login_time":"2015-12-25T12:00:00Z"} As you see, index login-2015.12.23 has two docs, index login-2015.12.24 has one doc, index login-2015.12.23 has one doc. And now I wanna get the result { "hits"… Read More Elasticsearch How to count total docs by date

Elasticsearch shows data as buffer type in Kibana

I am trying to index one json to elastic search. It seems to be working fine as it is not giving any error. I have indexed document as below. await client.index({ id: fieldId.toString(), index: ‘project_documents_textfielddata’, body: { FieldId: fieldId, DocumentId: documentId, Value: fieldData.fieldHTMLText, }, routing: projectId.toString(), }); But in elasticsearch kibana it is showing as… Read More Elasticsearch shows data as buffer type in Kibana

ElasticSearch get top 2 results per specific term in aggregations

Given this query, i want to retrieve and limit only to top 2 cities from each country. So, given the most popular country, retrieve top 2 cities, then next country, top 2 cities and etcera. { "size": 0, "aggs": { "user_city_id": { "terms": { "field": "user.city_id", "size": 999 }, "aggs": { "user_country_id": { "terms": {… Read More ElasticSearch get top 2 results per specific term in aggregations

How to export the whole elasticsearch index data into a csv file

I am planning to fetch all the rows in an elastic search index, and then store the rows as a CSV file. However, most methods that I have tried, ended up giving me size limit errors. curl -k -u username:password -XGET "https://xx.xx.xx.xx:xxxx/foo-index/_search?scroll=10m" -H ‘Content-Type: application/json’ -d'{ "from": 0, "size": 933963, "query" : { "match_all" :… Read More How to export the whole elasticsearch index data into a csv file

cannot create custom analyzer elaticsearch

I’m trying to create a custom analyzer in elasticsearch. here is the analyzer { "settings": { "analysis": { "analyzer": { "my_analyzer": { "tokenizer" : "standard", "filter" : ["custom_stopper", "custom_stems", "custom_synonyms"] }, "filter" : { "custom_stopper" : { "type" : "stop", "stopwords_path" : "analyze/stopwords.txt" }, "custom_stems" : { "type" : "stemmer_override", "rules_path" : "analyze/stem.txt" }, "custom_synonyms"… Read More cannot create custom analyzer elaticsearch