lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MOYSE Gilles (Cetelem)" <gilles.mo...@cetelem.fr>
Subject Boost in Query Parser
Date Wed, 12 Nov 2003 15:53:56 GMT
Hello.

I've made a Filter which recognizes special words and return them in a
"boosted form", in a QueryParser sense.
For instance, when the filter receives "special_word", it returns
"special_word^3", so as to boost it.
The problem is that the QueryParser understands the boost syntax when the
string is given as an argument to the "parse" function, but does not get it
when it is generated by a filter in the Analyzer.
So, when my filter transforms "special_word" to "special_filter^3", the
QueryParser does not create a Query object with "special_word" as value to
look for and boost to 3, but with "special_word^3" to search and boost to 1.
Of course, it does not match anything.

Does anyone knows a solution to that problem ? Do I have to write my own
QueryParser from the beginning or do I just have to correct 2 ot 3 lines of
the original QueryParser to make it work the I'd like it to work ?

Thanks a lot.

Gilles Moyse.

-----Message d'origine-----
De : Erik Hatcher [mailto:erik@ehatchersolutions.com]
Envoyé : mercredi 12 novembre 2003 15:16
À : Lucene Users List
Objet : Re: Can use Lucene be used for this


On Wednesday, November 12, 2003, at 07:34  AM, Hackl, Rene wrote:
>>> col2 like %aa%
>
>> Lucene doesn't handle queries where the start of the term is not known
>> very efficiently.
>
> Is it really able to handle them at all? I thought "*foo"-type queries 
> were
> not supported.

They are not supported by the QueryParser, but an API created 
WildcardQuery supports it.

I certainly do not recommend using prefix-style wildcard queries 
though, knowing what happens under the covers.

	Erik


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

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