Skip to content

Forbid the usage or range queries with a range based on current time in percolator queries#19327

Merged
martijnvg merged 1 commit intoelastic:masterfrom
martijnvg:percolator_disallow_range_queries_with_no_ranges_and_small_cleanups
Jul 8, 2016
Merged

Forbid the usage or range queries with a range based on current time in percolator queries#19327
martijnvg merged 1 commit intoelastic:masterfrom
martijnvg:percolator_disallow_range_queries_with_no_ranges_and_small_cleanups

Conversation

@martijnvg
Copy link
Copy Markdown
Member

If there are percolator queries containing range queries with ranges based on the current time then this can lead to incorrect results if the percolate query gets cached. These ranges are changing each time the percolate query gets executed and if this query gets cached then the results will be based on how the range was at the time when the percolate query got cached.

The ExtractQueryTermsService has been renamed QueryAnalyzer and now only deals with analyzing the query (extracting terms and deciding if the entire query is a verified match) . The PercolatorFieldMapper is responsible for adding the right fields based on the analysis the QueryAnalyzer has performed, because this is highly dependent on the field mappings. Also the PercolatorFieldMapper is responsible for creating the percolate query.

@jpountz
Copy link
Copy Markdown
Contributor

jpountz commented Jul 8, 2016

LGTM

… the current time

If there are percolator queries containing `range` queries with ranges based on the current time then this can lead to incorrect results if the `percolate` query gets cached.  These ranges are changing each time the `percolate` query gets executed and if this query gets cached then the results will be based on how the range was at the time when the `percolate` query got cached.

The ExtractQueryTermsService has been renamed `QueryAnalyzer` and now only deals with analyzing the query (extracting terms and deciding if the entire query is a verified match) . The `PercolatorFieldMapper` is responsible for adding the right fields based on the analysis the `QueryAnalyzer` has performed, because this is highly dependent on the field mappings. Also the `PercolatorFieldMapper` is responsible for creating the percolate query.
@martijnvg martijnvg force-pushed the percolator_disallow_range_queries_with_no_ranges_and_small_cleanups branch from e83e8e8 to ff5527f Compare July 8, 2016 12:21
@martijnvg martijnvg merged commit ff5527f into elastic:master Jul 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>breaking :Search Relevance/Percolator Reverse search: find queries that match a document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants