You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Lutz Fechner <LF...@hubwoo.com> on 2012/02/01 11:41:33 UTC

Lucene 2.9.4 Wildcard Search, Boost and Sorting

Hi,

I have an issue with Lucene 2.9.4 and sorting of wildcard queries.

If I set a boost to some documents during indexing like this:

doc.setBoost(1000.00);


and execute a query like this:

PRODUCT_GROUP:2020*


I don't get results with a high boost value returned before the documents with no boost.

In the earlier version of Lucene (2.3.2) we used before this worked fine.


Is there a way to enable this again in 2.9.4?



Thanks


Lutz Fechner
____________________________________________

Team Lead eContent Development


Brühler Str. 9
53119 Bonn
Tel: +49 228 6195 482
Mobile: +49 175 7279 482
lfechner@hubwoo.com - www.hubwoo.com <http://www.hubwoo.com/> 



RE: Lucene 2.9.4 Wildcard Search, Boost and Sorting

Posted by Lutz Fechner <LF...@hubwoo.com>.
Thanks for the quick response.

Will try to do it this way:

	Query q = null;
	MultiFieldQueryParser par = new MultiFieldQueryParser(Version.LUCENE_29, searchFields, analyzer, boosts);
		
	par.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
		
	par.setAllowLeadingWildcard(true);
		
	q = par.parse(searchTerm);

	BooleanQuery.setMaxClauseCount(65535);


Best Regards

Lutz


-----Original Message-----
From: Uwe Schindler [mailto:uwe@thetaphi.de] 
Sent: Mittwoch, 1. Februar 2012 11:46
To: java-user@lucene.apache.org
Subject: RE: Lucene 2.9.4 Wildcard Search, Boost and Sorting

Hi,

all MultiTermQueries are constant score by default since Lucene 2.9, you can
change that back to scoring mode:
WildcardQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE)

This slows down the query immense or throws TooManyClauses exceptions if too
many terms match the wildcard.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Lutz Fechner [mailto:LFechner@hubwoo.com]
> Sent: Wednesday, February 01, 2012 11:42 AM
> To: java-user@lucene.apache.org
> Subject: Lucene 2.9.4 Wildcard Search, Boost and Sorting
> 
> Hi,
> 
> I have an issue with Lucene 2.9.4 and sorting of wildcard queries.
> 
> If I set a boost to some documents during indexing like this:
> 
> doc.setBoost(1000.00);
> 
> 
> and execute a query like this:
> 
> PRODUCT_GROUP:2020*
> 
> 
> I don't get results with a high boost value returned before the documents
with
> no boost.
> 
> In the earlier version of Lucene (2.3.2) we used before this worked fine.
> 
> 
> Is there a way to enable this again in 2.9.4?
> 
> 
> 
> Thanks
> 
> 
> Lutz Fechner
> ____________________________________________
> 
> Team Lead eContent Development
> 
> 
> Brühler Str. 9
> 53119 Bonn
> Tel: +49 228 6195 482
> Mobile: +49 175 7279 482
> lfechner@hubwoo.com - www.hubwoo.com <http://www.hubwoo.com/>
> 



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




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


RE: Lucene 2.9.4 Wildcard Search, Boost and Sorting

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

all MultiTermQueries are constant score by default since Lucene 2.9, you can
change that back to scoring mode:
WildcardQuery.setRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE)

This slows down the query immense or throws TooManyClauses exceptions if too
many terms match the wildcard.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Lutz Fechner [mailto:LFechner@hubwoo.com]
> Sent: Wednesday, February 01, 2012 11:42 AM
> To: java-user@lucene.apache.org
> Subject: Lucene 2.9.4 Wildcard Search, Boost and Sorting
> 
> Hi,
> 
> I have an issue with Lucene 2.9.4 and sorting of wildcard queries.
> 
> If I set a boost to some documents during indexing like this:
> 
> doc.setBoost(1000.00);
> 
> 
> and execute a query like this:
> 
> PRODUCT_GROUP:2020*
> 
> 
> I don't get results with a high boost value returned before the documents
with
> no boost.
> 
> In the earlier version of Lucene (2.3.2) we used before this worked fine.
> 
> 
> Is there a way to enable this again in 2.9.4?
> 
> 
> 
> Thanks
> 
> 
> Lutz Fechner
> ____________________________________________
> 
> Team Lead eContent Development
> 
> 
> Brühler Str. 9
> 53119 Bonn
> Tel: +49 228 6195 482
> Mobile: +49 175 7279 482
> lfechner@hubwoo.com - www.hubwoo.com <http://www.hubwoo.com/>
> 



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