Optimizing Percolator queries with no text fields

(Joan Balagueró) #1

I'm trying to find out if, in my use case, it is worth to try to optimize the percolator queries in ES 6.4.

In these queries we only have dates, integers or keywords (no text fields). And we only use range and term. Below an example:

{
  "filter":
    [
      { "term" : { "HotelCode" : "107" } },
      { "range" : { "StayDateStart": { "lte": "20160319" }, "StayDateEnd": { "gte": "20160313" } } }
    ]
}

Probably the following is the most complicated example we can have:

{
 "filter" : [ 
			  { "range" : { "check_in_date": { "lte": "04/10/2019" } } }, 
			  { "range" : { "check_out_date": { "gte": "02/10/2019" } } },
			  { 
		          "nested":
				   {
				     "path": "hotel",
				     "query" :
				       { 
				         "bool":
				         {
				           "must" :
					         [
				               { "term": { "hotel.hotel_code": "7"} },
					           { "bool":
				                       { "should":
					                     [
				                            { "term" : { "hotel.room_code_extended" : "1"} },
				                            { "term" : { "hotel.room_code" : "1" } },
				                            { "term" : { "hotel.room_code_ocupacion" : "1"} }
				                         ]
				                       }
			                    }
					         ]
					      }
				       }
			      }
			   } 
			]
}

The percolator queries remain 10s in the index, after this time they are removed. In this 10s we can add 50 queries to the percolator index at most.

And we can match about 1000 queries per second to this percolator index, so in our worst case 1000 x 50 = 50,000 matches per second.

We have tried several performance tests, and it seems working fine.

We have read the percolator section about how optimize it, but it only talks about optimizing the query time text analysis. Here we don't have text fields, so that's why we are asking if this parse/query time analysis can be optimized in any way in our case.

(system) closed #2

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