lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Otis Gospodnetic <>
Subject Re: Correct way to search across all fields
Date Fri, 17 Sep 2004 15:03:31 GMT
You are doing it correctly.  I tend to use MultiFieldQueryParser, but
lots of people have 1 'all' field like you.


--- Peter Pimley <> wrote:

> Hello everybody.
> I'm a relative newbie with lucene, but I've got it set up on my
> system 
> and it's working well.
> I'd like it to be the case that the default behaviour is to search 
> across all the Fields of all my Documents.  At the moment, when I
> create 
> my Document object, the last thing I do is to create an extra Field 
> called 'all', whose content is the concatinated contents of all the 
> other fields.  Then, when I use the QueryParser, I pass in 'all' as
> the 
> value of the default field parameter.
> This works, but it makes my index a little under twice as large as it
> would otherwise be.  That's not a great problem as I'm nowhere near 
> bound by storage space (yet), but it feels a bit weird.  I can't use
> a 
> MultiFieldQueryParser, because at the point where I parse the query,
> I 
> don't actually know the names of the fields.
> Have I missed the correct way to do this?
> Thanks in advance,
> Peter Pimley
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message