apache / apache/lucene

TermAutomatonQuery should be two-phased [LUCENE-6717]

Open
#7,775 7 comments 0 reactions 1 assignee Claimed by @mikemccand View on GitHub
legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

`TermAutomatonQuery` (still in sandbox) is a simple way to get accurate query-time multi-token synonyms using the new `SynonymGraphFilter` from #7722. It already has a utility class to directly translate an incoming `TokenStream` into a corresponding query.

However the query is likely quite slow because it always iterates positions for all terms in the automaton.

I think one simple approach is to walk the automaton and find the subset of terms (if any) that appear in common to all paths, and then approximate with `ConjunctionDISI` like `PhraseQuery` does. Such a subset doesn't always exist for an automaton (i.e. it could be empty), so the logic would have to be conditional...

And I think there are more complex approximations we could make, but using `ConjunctionDISI` seems like a simple start.

---
Migrated from [LUCENE-6717](https://issues.apache.org/jira/browse/LUCENE-6717) by Michael McCandless (@mikemccand), 1 vote, updated Aug 10 2015
Attachments: [LUCENE-6717.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-6717/LUCENE-6717.patch) (versions: 2)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.