You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by abhishek jain <ab...@gmail.com> on 2014/03/25 18:29:15 UTC
AND not as a boolean operator in Phrase
hi friends,
when i search for "A and B" it gives me result for A , B , i am not sure
why?
Please guide how can i exact match when it is within phrase/quotes.
--
Thanks and kind Regards,
Abhishek jain
Re: AND not as a boolean operator in Phrase
Posted by Ahmet Arslan <io...@yahoo.com>.
Hi Abhishek,
Your best bet is dismax query parser which does not recognize and/AND as an operator.
q="A and B"&qf=someField&defType=dismax
Ahmet
On Wednesday, April 2, 2014 10:01 PM, abhishek jain <ab...@gmail.com> wrote:
Hi,
Ok thanks,
i want to search for phrase "A and B" with the *and *word sandwiched
between A and B. I dont want to work with and as a boolean operator when
within quotes.
I have and as a stop word and i dont want to reindex data.
What is my best bet.
thanks
abhishek jain
On Sun, Mar 30, 2014 at 2:33 AM, Bob Laferriere <sp...@icloud.com>wrote:
> If you are using edismax you need to use AND. So A AND B will ignore the
> stop word and apply the Boolean operator. You can configure edismax to
> ignore Boolean stop words that are lowercase.
>
> Regards,
>
> Bob
>
> > On Mar 26, 2014, at 2:39 AM, abhishek jain <ab...@gmail.com>
> wrote:
> >
> > Hi Jack,
> > You are right, i am using 'and' as a stop word in both indexing and
> query,
> >
> > Should i use it only during indexing?
> >
> > thanks
> >
> >
> >
> > On Tue, Mar 25, 2014 at 11:09 PM, Jack Krupansky <
> jack@basetechnology.com>wrote:
> >
> >> What does your field type analyzer look like?
> >>
> >> I suspect that you have a stop filter which cause "and" to be removed.
> >>
> >> -- Jack Krupansky
> >>
> >> -----Original Message----- From: abhishek jain Sent: Tuesday, March 25,
> >> 2014 1:29 PM To: solr-user@lucene.apache.org Subject: AND not as a
> >> boolean operator in Phrase
> >> hi friends,
> >>
> >> when i search for "A and B" it gives me result for A , B , i am not sure
> >> why?
> >>
> >> Please guide how can i exact match when it is within phrase/quotes.
> >>
> >> --
> >> Thanks and kind Regards,
> >> Abhishek jain
> >
> >
> >
> > --
> > Thanks and kind Regards,
> > Abhishek jain
> > +91 9971376767
>
--
Thanks and kind Regards,
Abhishek jain
+91 9971376767
Re: AND not as a boolean operator in Phrase
Posted by abhishek jain <ab...@gmail.com>.
Hi,
Ok thanks,
i want to search for phrase "A and B" with the *and *word sandwiched
between A and B. I dont want to work with and as a boolean operator when
within quotes.
I have and as a stop word and i dont want to reindex data.
What is my best bet.
thanks
abhishek jain
On Sun, Mar 30, 2014 at 2:33 AM, Bob Laferriere <sp...@icloud.com>wrote:
> If you are using edismax you need to use AND. So A AND B will ignore the
> stop word and apply the Boolean operator. You can configure edismax to
> ignore Boolean stop words that are lowercase.
>
> Regards,
>
> Bob
>
> > On Mar 26, 2014, at 2:39 AM, abhishek jain <ab...@gmail.com>
> wrote:
> >
> > Hi Jack,
> > You are right, i am using 'and' as a stop word in both indexing and
> query,
> >
> > Should i use it only during indexing?
> >
> > thanks
> >
> >
> >
> > On Tue, Mar 25, 2014 at 11:09 PM, Jack Krupansky <
> jack@basetechnology.com>wrote:
> >
> >> What does your field type analyzer look like?
> >>
> >> I suspect that you have a stop filter which cause "and" to be removed.
> >>
> >> -- Jack Krupansky
> >>
> >> -----Original Message----- From: abhishek jain Sent: Tuesday, March 25,
> >> 2014 1:29 PM To: solr-user@lucene.apache.org Subject: AND not as a
> >> boolean operator in Phrase
> >> hi friends,
> >>
> >> when i search for "A and B" it gives me result for A , B , i am not sure
> >> why?
> >>
> >> Please guide how can i exact match when it is within phrase/quotes.
> >>
> >> --
> >> Thanks and kind Regards,
> >> Abhishek jain
> >
> >
> >
> > --
> > Thanks and kind Regards,
> > Abhishek jain
> > +91 9971376767
>
--
Thanks and kind Regards,
Abhishek jain
+91 9971376767
Re: AND not as a boolean operator in Phrase
Posted by Bob Laferriere <sp...@icloud.com>.
If you are using edismax you need to use AND. So A AND B will ignore the stop word and apply the Boolean operator. You can configure edismax to ignore Boolean stop words that are lowercase.
Regards,
Bob
> On Mar 26, 2014, at 2:39 AM, abhishek jain <ab...@gmail.com> wrote:
>
> Hi Jack,
> You are right, i am using 'and' as a stop word in both indexing and query,
>
> Should i use it only during indexing?
>
> thanks
>
>
>
> On Tue, Mar 25, 2014 at 11:09 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
>
>> What does your field type analyzer look like?
>>
>> I suspect that you have a stop filter which cause "and" to be removed.
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: abhishek jain Sent: Tuesday, March 25,
>> 2014 1:29 PM To: solr-user@lucene.apache.org Subject: AND not as a
>> boolean operator in Phrase
>> hi friends,
>>
>> when i search for "A and B" it gives me result for A , B , i am not sure
>> why?
>>
>> Please guide how can i exact match when it is within phrase/quotes.
>>
>> --
>> Thanks and kind Regards,
>> Abhishek jain
>
>
>
> --
> Thanks and kind Regards,
> Abhishek jain
> +91 9971376767
Re: AND not as a boolean operator in Phrase
Posted by abhishek jain <ab...@gmail.com>.
Hi Jack,
You are right, i am using 'and' as a stop word in both indexing and query,
Should i use it only during indexing?
thanks
On Tue, Mar 25, 2014 at 11:09 PM, Jack Krupansky <ja...@basetechnology.com>wrote:
> What does your field type analyzer look like?
>
> I suspect that you have a stop filter which cause "and" to be removed.
>
> -- Jack Krupansky
>
> -----Original Message----- From: abhishek jain Sent: Tuesday, March 25,
> 2014 1:29 PM To: solr-user@lucene.apache.org Subject: AND not as a
> boolean operator in Phrase
> hi friends,
>
> when i search for "A and B" it gives me result for A , B , i am not sure
> why?
>
> Please guide how can i exact match when it is within phrase/quotes.
>
> --
> Thanks and kind Regards,
> Abhishek jain
>
--
Thanks and kind Regards,
Abhishek jain
+91 9971376767
Re: AND not as a boolean operator in Phrase
Posted by Jack Krupansky <ja...@basetechnology.com>.
What does your field type analyzer look like?
I suspect that you have a stop filter which cause "and" to be removed.
-- Jack Krupansky
-----Original Message-----
From: abhishek jain
Sent: Tuesday, March 25, 2014 1:29 PM
To: solr-user@lucene.apache.org
Subject: AND not as a boolean operator in Phrase
hi friends,
when i search for "A and B" it gives me result for A , B , i am not sure
why?
Please guide how can i exact match when it is within phrase/quotes.
--
Thanks and kind Regards,
Abhishek jain
Re: AND not as a boolean operator in Phrase
Posted by François Schiettecatte <fs...@gmail.com>.
Better to user '+A +B' rather than AND/OR, see:
http://searchhub.org/2011/12/28/why-not-and-or-and-not/
François
On Mar 25, 2014, at 10:21 PM, Koji Sekiguchi <ko...@r.email.ne.jp> wrote:
> (2014/03/26 2:29), abhishek jain wrote:
>> hi friends,
>>
>> when i search for "A and B" it gives me result for A , B , i am not sure
>> why?
>>
>> Please guide how can i exact match when it is within phrase/quotes.
>
> Generally speaking (w/ LuceneQParser), if you want phrase match results,
> use quotes, i.e. q="A B". If you want results which contain both terms A
> and B, do not use quotes but boolean operator AND, i.e. q=A AND B.
>
> koji
> --
> http://soleami.com/blog/comparing-document-classification-functions-of-lucene-and-mahout.html
Re: AND not as a boolean operator in Phrase
Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
(2014/03/26 2:29), abhishek jain wrote:
> hi friends,
>
> when i search for "A and B" it gives me result for A , B , i am not sure
> why?
>
> Please guide how can i exact match when it is within phrase/quotes.
Generally speaking (w/ LuceneQParser), if you want phrase match results,
use quotes, i.e. q="A B". If you want results which contain both terms A
and B, do not use quotes but boolean operator AND, i.e. q=A AND B.
koji
--
http://soleami.com/blog/comparing-document-classification-functions-of-lucene-and-mahout.html