Help needed with Percolate performance issue

I am trying to figure out a performance issue related to Elasticsearch Percolate functionality. I have provided steps to recreate below and the sample data has been created off the Elasticsearch Percolate documentation (https://www.elastic.co/guide/en/elasticsearch/reference/6.2/query-dsl-percolate-query.html).

Steps to recreate:

Elasticsearch version: 6.2.2 (should be recreatable in higher versions)

(1) create percolate index

(2) Load the below query to the index created in step (1) 200000 times. In our real scenario we are able to recreate this issue with 1000 unique queries, but I can't share the real queries here.

{"query" : {"match" : {"message" : "bonsai tree"}}}

(3) Run the following Percolate query and observe that the response time is around 800 ms (you can run the query a couple of times)

(4) Now run the below query and observer that this takes only 5 ms. The only difference between this and the above query is the length of the text in message field.

(5) Now just add ONE word "tree" at the end of the the text in the above query and you will notice the response time go back to around 800 ms

I would appreciate if someone can explain this behavior because that can help us optimze percolate response times for our real world queries and documents with fields that have long text.

Let me know if you are not able to recreate this scenario and I can work with you.

Thanks
-Deepak

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.