Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intervals queries fail percolator term extraction #45639

Closed
OrionNebula opened this issue Aug 15, 2019 · 2 comments · Fixed by #49238
Closed

intervals queries fail percolator term extraction #45639

OrionNebula opened this issue Aug 15, 2019 · 2 comments · Fixed by #49238
Labels
:Search Relevance/Percolator Reverse search: find queries that match a document Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch

Comments

@OrionNebula
Copy link

Elasticsearch version (bin/elasticsearch --version): 7.2.0 (deb)

Plugins installed: [ discovery-ec2, analysis-icu ]

JVM version (java -version): 1.8.0_131

OS version (uname -a if on a Unix-like system): Linux 4.4.0-1085-aws #96-Ubuntu SMP Tue Jun 11 09:08:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

Percolator queries that contain an intervals clause fail term extraction.

Expected: Intervals queries will be supported by percolator term extraction and pre-filtering.
Actual: Intervals queries fail term extraction and are always considered for percolation.

Steps to reproduce:

  1. Create an index containing a percolator field (name doesn't matter, but I used "query")
  2. Index a query containing an intervals clause
  3. Search for { "term": { "query.extraction_result": "failed" } }
@jimczi jimczi added the :Search Relevance/Percolator Reverse search: find queries that match a document label Aug 16, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jimczi
Copy link
Contributor

jimczi commented Aug 16, 2019

@romseygeek can you take a look ?

romseygeek added a commit that referenced this issue Nov 18, 2019
Lucene now allows us to explore the structure of a query using QueryVisitors,
delegating the knowledge of how to recurse through and collect terms to the
query implementations themselves. The percolator currently has a home-grown
external version of this API to construct sets of matching terms that must be
present in a document in order for it to possibly match the query.

This commit removes the home-grown implementation in favour of one using
QueryVisitor. This has the added benefit of making interval queries available
for percolator pre-filtering. Due to a bug in multi-term intervals (LUCENE-9050)
it also includes a clone of some of the lucene intervals logic, that can be removed
once upstream has been fixed.

Closes #45639
romseygeek added a commit that referenced this issue Nov 20, 2019
Lucene now allows us to explore the structure of a query using QueryVisitors,
delegating the knowledge of how to recurse through and collect terms to the
query implementations themselves. The percolator currently has a home-grown
external version of this API to construct sets of matching terms that must be
present in a document in order for it to possibly match the query.

This commit removes the home-grown implementation in favour of one using
QueryVisitor. This has the added benefit of making interval queries available
for percolator pre-filtering. Due to a bug in multi-term intervals (LUCENE-9050)
it also includes a clone of some of the lucene intervals logic, that can be removed
once upstream has been fixed.

Closes #45639
@javanna javanna added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search Relevance/Percolator Reverse search: find queries that match a document Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants