lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Baudoux>
Subject benefit of combining fields into one vs. booleanQuery
Date Tue, 21 Aug 2007 20:38:57 GMT
	Hi everyone,

	My question : i have medias with a "title" field and a "caption"  
field and a "keywords" field.

I want to be able to search in those 3 fields at the same time. For  
example, if i search "black car" the boolean query looks like this  
combination of termqueries:

(title=black or keywords=black or caption=black) and (title=car or  
keywords= car or caption= car).

So if "black" is in caption and "car" is in title I must find the media.

I'm afraid that those boolean queries will be slow when there are a  
lot of terms in the query.

I can, at index time add a "fulltext" field to each media that will  
contains title, caption and keywords concatenated.

the query becomes :  (fulltext=black and fulltext=car), much simpler.

But i must still be able to search only in title or only in caption  
or only in keywords, so I must still add the other fields, doubling  
the indexed terms.

Has someone done a similar thing? Is it worth it, or will the First  
boolean query remain fast enough?



Antoine Baudoux
Development Manager
Tél.: +32 2 333 58 44
GSM: +32 499 534 538
Fax.: +32 2 648 16 53

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