You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Lance Norskog <go...@gmail.com> on 2013/06/03 05:46:56 UTC
Zero-position query?
What is a Lucene query that will find two words at the same term
position? Is there a class that will do this? Is the feature available
from the Lucene query syntax or any other syntax parsers?
For example, if I'm using synonyms at index time I should get the base
word and all synonyms at the same position. What is a query that will
find a document with the synonym substituted, but will not find a
document which has the base word and a synonym at two different positions?
Thanks,
Lance.
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Zero-position query?
Posted by Lance Norskog <go...@gmail.com>.
Thanks! Now, to hunt for this in the parsers.
On 06/02/2013 09:16 PM, Israel Tsadok wrote:
> You can do this with a PhraseQuery[1]. Just add more terms with position 0.
>
> [1] http://lucene.apache.org/core/4_3_0/core/org/apache/lucene/search/PhraseQuery.html#add(org.apache.lucene.index.Term,
> int)
>
>
> On Mon, Jun 3, 2013 at 6:46 AM, Lance Norskog <go...@gmail.com> wrote:
>
>> What is a Lucene query that will find two words at the same term position?
>> Is there a class that will do this? Is the feature available from the
>> Lucene query syntax or any other syntax parsers?
>>
>> For example, if I'm using synonyms at index time I should get the base
>> word and all synonyms at the same position. What is a query that will find
>> a document with the synonym substituted, but will not find a document which
>> has the base word and a synonym at two different positions?
>>
>> Thanks,
>>
>> Lance.
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.**apache.org<ja...@lucene.apache.org>
>> For additional commands, e-mail: java-user-help@lucene.apache.**org<ja...@lucene.apache.org>
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Zero-position query?
Posted by Israel Tsadok <it...@gmail.com>.
You can do this with a PhraseQuery[1]. Just add more terms with position 0.
[1] http://lucene.apache.org/core/4_3_0/core/org/apache/lucene/search/PhraseQuery.html#add(org.apache.lucene.index.Term,
int)
On Mon, Jun 3, 2013 at 6:46 AM, Lance Norskog <go...@gmail.com> wrote:
> What is a Lucene query that will find two words at the same term position?
> Is there a class that will do this? Is the feature available from the
> Lucene query syntax or any other syntax parsers?
>
> For example, if I'm using synonyms at index time I should get the base
> word and all synonyms at the same position. What is a query that will find
> a document with the synonym substituted, but will not find a document which
> has the base word and a synonym at two different positions?
>
> Thanks,
>
> Lance.
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.**apache.org<ja...@lucene.apache.org>
> For additional commands, e-mail: java-user-help@lucene.apache.**org<ja...@lucene.apache.org>
>
>