lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: query parser field name aliases
Date Mon, 05 Jun 2006 00:42:48 GMT

On Jun 4, 2006, at 5:57 PM, karl wettin wrote:
> I was thinking it could be nice if the query parser handled aliases by
> passing a Map to the parser. The data could be compiled from the  
> index.
>
> "name", "nam", "na" and "n" all trigger on "name", taking there is no
> other field starting with an "n".
>
> Did anyone implement this, or should I hack one up?

Rather than hacking QueryParser, simply do some regex replaces on the  
string before handing it to parser.  n:karl would get replaced with  
name:karl.  ([a-z]*)\: replaced with the field name that matches $1.

	Erik


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