lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher St John <>
Subject 3.0.3 Contrib Query Parser : Custom Field Name Builder
Date Sat, 08 Jan 2011 01:44:20 GMT
I'm trying to:

 StandardQueryTreeBuilder b = …;
 b.setBuilder( "myfield", fieldSpecificBuilder);

In the debugger I see that the builder is registered in the
QueryTreeBuilder's fieldNameBuilders map.

When parsing, QueryTreeBuilder.getBuilder tries to look
up the builder by using the FieldableNode's field but the
debugger says the node's field is an UnescapedCharSequence,
not a String, and the lookup fails.

Registering the builder with an UnescapedCharSequence
for the name instead of a String doesn't seem to help,
presumably because UCS doesn't have a hash an equals
or hash method.

Suggestions? I've worked around it by registering a class
based builder, checking for the field name and either
delegating to the original builder or doing my custom
processing, but it's a little awkward.


Christopher St. John

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message