lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: QueryParser over multiple fields
Date Thu, 29 Dec 2005 15:25:30 GMT

On Dec 29, 2005, at 9:31 AM, euw@cologne-systems.de wrote:
>>
>> Two options - MultiFieldQueryParser or building an aggregate single
>> field to search.  I use the aggregate field option, which entails
>> building an additional field for each document, I call it "contents",
>> and index _all_ of the searchable text into that field.
>>
>> 	Erik
>
>
> How about a BooleanQuery? I have documents with text, headlines, and
> keywords, each needing a different analyzer and boost factor. I'm
> experimenting with PerFieldAnalyzerWrapper and KeywordAnalyzer (as
> described in your book), constructing the Query from a
> QueryParser.parse(query, field, analyzer) query on each of the fields,
> connected as a BooleanQuery. Like this, i can use a different boost  
> factor
> and a different analyzer for each field, and tune the whole thing  
> quite
> easily. The drawback is that analyzer and query construction look a  
> little
> cumbersome.
>
> As i said, i've been only experimenting with this. I don't know if  
> this
> would work in production code, but i don't see why not. What's your  
> take
> on this?

That's a perfectly good approach as well.  I didn't mean to imply  
that there were only "two options", just that the two I suggested  
were the most commonly used ones.

	Erik


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


Mime
View raw message