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 Tate Avery <ta...@nstein.com> on 2004/04/01 17:30:38 UTC

Searching in "all"

Hello,

If I have, for example, 3 fields in my document (title, body, notes)... is there some easy what to search 'all'?


Below are the only 2 ideas I currently have/use:

1) If I want to search for 'x' in all, I do something like:
	title:x OR body:x OR notes:x

... but this does not really work if you are search for (a AND b) and a is in the title and b is in the notes, etc... leading to an explosion of boolean combinations it seems.


2) Actually index an 'all' field for my document by just concatenating the content from the title, body, and notes fields.
... but this doubles my index size.  :(


So, is there a better way out there?

Thanks,
Tate

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


Re: Searching in "all"

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 1, 2004, at 10:30 AM, Tate Avery wrote:
> 2) Actually index an 'all' field for my document by just concatenating 
> the content from the title, body, and notes fields.
> ... but this doubles my index size.  :(

This is actually my recommended approach.  As for doubling the index 
size - not necessarily.  If you only use stored fields for the ones 
that truly need to be retrievable things are more efficient space-wise. 
  For example, you do not need to store the "all" field (use 
Field.UnStored).

	Erik


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