[
https://issues.apache.org/jira/browse/LUCENE-6801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
David Smiley updated LUCENE-6801:
---------------------------------
Attachment: LUCENE_6801.patch
Here's an updated patch. I added a simple test, ported from one in
MultiPhraseQuery. I adjusted the class javadocs of both query classes a bit,
as well as their methods that add terms at specified positions.
> PhraseQuery incorrectly advertises it supports terms at the same position
> -------------------------------------------------------------------------
>
> Key: LUCENE-6801
> URL: https://issues.apache.org/jira/browse/LUCENE-6801
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/search
> Reporter: David Smiley
> Priority: Minor
> Attachments: LUCENE_6801.patch, LUCENE_6801.patch
>
>
> The following in PhraseQuery has been here since Sept 15th 2004 (by "goller"):
> {code:java}
> /**
> * Adds a term to the end of the query phrase.
> * The relative position of the term within the phrase is specified
> explicitly.
> * This allows e.g. phrases with more than one term at the same position
> * or phrases with gaps (e.g. in connection with stopwords).
> *
> */
> public Builder add(Term term, int position) {
> {code}
> Of course this isn't true; it's why we have MultiPhraseQuery. Yet we even
> allow you to have consecutive terms with the same positions. We shouldn't
> allow that; we should throw an exception. For my own sanity, I modified a
> simple MultiPhraseQuery test to use PhraseQuery instead and of course it
> didn't work.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]