lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Negative Wildcard Queries
Date Fri, 31 Oct 2014 18:47:13 GMT
Uhhhhm not sure what that means. Are you looking to not return
docs where "hello" is followed by "world", "worldiness", "worldly"? If
so the syntax is wrong...

But you'd need to use the ComplexPhraseQueryParser available in 4.8
to do something like that.

Best,
Erick

On Fri, Oct 31, 2014 at 10:17 AM, Prad Nelluru <prnell@microsoft.com> wrote:
> Thanks!
>
> Is it possible to say -"hello world"* ?
>
> -----Original Message-----
> From: Erick Erickson [mailto:erickerickson@gmail.com]
> Sent: Thursday, October 30, 2014 10:15 PM
> To: java-user
> Subject: Re: Negative Wildcard Queries
>
> Actually, "hello world*" is possible with the ComplexPhraseQueryParser as of 4.8, see
SOLR-1604 (yeah, it's been hanging around for a while).
>
> But to your question: Just prefix it with *:*, i.e. q=*:* -hello*
>
> Best,
> Erick
>
> On Thu, Oct 30, 2014 at 6:29 PM, Prad Nelluru <prnell@microsoft.com> wrote:
>> Hi all,
>>
>> Is it possible to query Lucene with a negative wildcard query like: -hello*? I know
wildcards aren't allowed inside phrase queries, so -"hello world*" isn't possible.
>>
>> Thanks,
>> Prad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message