lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <morus.wal...@tanto.de>
Subject Re: A TokenFilter to split words and numbers
Date Thu, 04 Nov 2004 12:00:50 GMT
william.sporrong writes:

> Does it have something to do with the
> QueryParser guessing what kind of query it is by examining the string and
> thus presumes that the first string should not be parsed into a PhraseQuery?
>
QueryParser creates a PhraseQuery for "words" that are tokenized to more
than one token.
You should see that in the serialized query.
>  
> 
> Anyways if there is a correct way to accomplish what I want could anyone
> please give me a hint? One way I thought about is preparsining the query and
> construct several subqueries i.e PhraseQuerys and so on and then combine
> them in a BooleanQuery but I guess there is a nicer solution?
> 
I guess you could overwrite the getFieldQuery method of query parser
and change the way queries are generated.
>  
> 
> I have a similar problem with another Filter Iäm trying to implement that
> should remove certain suffixes and replace them with a wildcard (
> bilar->bil*).
> 
If you expect bil* to be executed as a wildcard/prefix query, this
cannot work. The query parser parses the query, not the analyzer output.
Again you might introduce such behaviour in getFieldQuery.

Morus

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


Mime
View raw message