lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: "Field Grouping" query restrained to same field on a 'multi'-field'
Date Tue, 08 Aug 2006 18:03:49 GMT
On 8/8/06, Laurent Hoss <l.hoss@netbreeze.ch> wrote:
> Suppose having an Index containing Lucene documents, having multiple
> fields (equally) named 'paragraph'.
> Now I want to make a "Field Grouping" query (described in:
> http://lucene.apache.org/java/docs/queryparsersyntax.html )
>  "paragraph:( word1 AND word2 )"
> retrieving only documents where the terms word1,word2 appear in the SAME
> 'paragraph' Field (and not word1 in one 'paragraph' field, and word2
> possibly in another 'paragraph' field in this doc).

You could do this with the current query parser by putting large
position increment gaps between paragraphs that is guaranteed to be
larger than the largest paragraph.  Then you could use a sloppy phrase
query
"word1 word2"~10000 for instance.

That would also score documents higher the closer together the words
appeared (which may or may not be desirable).

-Yonik
http://incubator.apache.org/solr Solr, the open-source Lucene search server

---------------------------------------------------------------------
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