Elastic search _suggest caching

I use ElasticSearch to manage my main search engine and autocomplete tool. I am using version "1.0.1"

My problem: it seems that you have a fairly stable cache, and I can not get rid of it.

I reset all my mappings, restarted everything, so when I do

GET /myindex/film/_search
{
  "from" : 0, "size" : 10000,
  "fields": ["title"]
}

I get an empty result, and I'm pretty happy with that.

BUT when I submit this request:

GET /myindex/_suggest
{
  "hits" : {
    "text" : "south",
    "completion" : {
        "size" : 90,
        "field" : "suggest"
    }
  }
}

I get a lot of movie results!

How is this possible? How can I get rid of them?

+4
source share
3 answers

You have to use

POST /myindex/_optimize

or if you are worried about performance

POST /myindex/_optimize?only_expunge_deletes=true

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html#indexing ( , https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-optimize.html)

+1

, @andy. .

0

elasticsearch . , . .

- .

0

Source: https://habr.com/ru/post/1533985/


All Articles