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: How to search on all fields with one query ?
Date Thu, 18 Dec 2008 15:38:36 GMT
A lot depends upon what you mean by "search across all fields".
For single-term queries, that's pretty straight forward, but for, say,
(a AND b) what does it mean to "search across all fields"? Should
you get a hit if a appears only in field1 and b appears only in field 2?
Or should you only get a hit when both terms appear in the same field?

The answer to your original question depends a lot on how you answer
the above.

Assuming that putting all the terms in a giant field actually would
work, that's what I'd try first. Create it indexed (but not stored). I'd
try this approach, because searching on that  would be much less
complex than fiddling with cloning the search across 40 fields. But
this may not be possible given the first paragraph above....

If you can I think you'd be surprised at how little this actually adds to
your index
size. The index you're talking about isn't very big compared to many, so
I really don't think that "saving space" is worth the complexity and the
cost in terms of getting it all to actually work.

Best
Erick

On Thu, Dec 18, 2008 at 10:09 AM, DELAVENNE Guillaume <
GDELAVENNE@generali.fr> wrote:

> Hi,
>
> I'm beginner on Lucene. I'm working on a Poc Lucene project at Generali
> France company.
>
> I have 40 fields (max ten words by field) in my index of about 6
> millions documents.
> I need to search a word in all fields.
>
> Must I create a field "content" with all the informations of the others
> fields ?
> Do you have another way ?
>
> Many thanks,
> Guillaume
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message