Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

Basic searching doubt

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


hrishikesh_agashe at persistent

Oct 30, 2009, 9:58 PM

Post #1 of 2 (395 views)
Permalink
Basic searching doubt

Hi,

If I search for string "A B" (i.e. A followed by a space followed by B) and I get 20 hits, then is it correct to expect that if I search for "A" (i.e. only A), I will get at least 20 hit or more? Similarly for if I search for B, I will get 20 hits or more?

--Hrishi

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.


r.ventaglio at gmail

Oct 31, 2009, 2:40 AM

Post #2 of 2 (359 views)
Permalink
Re: Basic searching doubt [In reply to]

If you search "A B" (with quotes) it is correct, but if you search only A B
(without quotes) it is not correct, because, by default the query parser
creates "OR" queries.
So searching A B you will find all documents that contains A or B, while
searching only A or only B you will normally find less documents!
If you want to search all documents that contains A and B, you should write
the query as +A +B (or change the default operator for query parser from OR
to AND).

Bye
Raf

On Sat, Oct 31, 2009 at 5:58 AM, Hrishikesh Agashe <
hrishikesh_agashe [at] persistent> wrote:

> Hi,
>
> If I search for string "A B" (i.e. A followed by a space followed by B) and
> I get 20 hits, then is it correct to expect that if I search for "A" (i.e.
> only A), I will get at least 20 hit or more? Similarly for if I search for
> B, I will get 20 hits or more?
>
> --Hrishi
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Ltd. It is intended only for the use of
> the individual or entity to which it is addressed. If you are not the
> intended recipient, you are not authorized to read, retain, copy, print,
> distribute or use this message. If you have received this communication in
> error, please notify the sender and delete all copies of this message.
> Persistent Systems Ltd. does not accept any liability for virus infected
> mails.
>

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.