Remove pre-filter phase in search #56016
Labels
:Search/Search
Search-related issues that do not fall into other categories
Team:Search
Meta label for search team
Uh oh!
There was an error while loading. Please reload this page.
The PR #25658 add pre-filter in search phase,It used to skip shard if not document that is within request date range.this will send can_match RPC to datanode to get if can match.
The pre-filter used in Range query in Date field,this Feature use Lucene PointValues.getMinPackedValue、PointValues.getMaxPackedValue to compare Is there an intersection.
But,This is not necessary.because Lucene will skip any segments if the segment is OUTSIDE the query range(for any Numeric field),this call CELL_OUTSIDE_QUERY.ref to here Lucene use segment's MinPackedValue/MaxPackedValue to get Relation,if Relation is CELL_OUTSIDE_QUERY,it will do nothing,so skip the segment
Therefore, the pre-filter cannot reduce the query time.
I test in my cluster: three nodes, on three physical machine,34c,196g
Index data for test
I use filebeat indices with nginx log ,the indices are below:
it has 11227 segments:
the doc is more than 10000:
Compare query results
The first,perform Range search in date field,this will match none,and it took 31ms
step2 ,add ?pre_filter_shard_size=1000 param to skip pre-filter phase,the response took 23ms
step 3,perform Range search in long field,this will match none,and it took 50ms
the query times are similar in two request.the pre-filter has no improvement,so i think it can remove from Elasticsearch
The text was updated successfully, but these errors were encountered: