> The boost (index time) does not work
> when i am searching for a word with a wildcard appended to
> the end.
> I stumbled on to this "feature" and its pretty much a show
> stopper for me.
> I am implementing a live search feature where i always have
> an wildcard in the last word that is currently being written
> by the user.
> Will this be fixed anytime soon or does anyone have a
> workaround?
> 
> Example :
> "playstation*" gives an result with unboosted items but
> "playstation" gives the correct one.


Javadoc of SolrQueryParser says:

 <p>
 * This class also deviates from the Lucene QueryParser by using 
 * ConstantScore versions of RangeQuery and PrefixQuery to prevent 
 * TooManyClauses exceptions.
 * </p> 

If you want to disable this behavior you can modify 
protected Query getPrefixQuery(String field, String termStr) 
method of SolrQueryParser. But for this to work you also need to write a class 
that extends QParserPlugin and uses you new SolrQueryParser. You need to define 
your new QParserPlugin in solrconfig.xml as described here [1]

[1] http://wiki.apache.org/solr/SolrPlugins#QParserPlugin

But prefix queries can easily cause TooManyBooleanClauses if the prefix is 
short like a*. Since it is going to OR all terms starting with a. Performance 
can be killer in such cases. I think thats why Solr uses ConstantScore 
versions. If you want you can increase this number (default is 1024) in 
solrconfig.xml <maxBooleanClauses>1024</maxBooleanClauses>

I do not know how to solve your problem without writing custom code.

Hope this helps.


      

Reply via email to