lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Solr Trey <>
Subject Issue with Function Query on Field Names with a Hyphen
Date Thu, 13 Aug 2009 03:04:00 GMT
Hey Everyone,

So, I was experimenting with some function queries today, and came across
something disturbing:

The following query works fine (field name: rank_i):

But the following query (field name: rank-i) throws a Parse Error (returns

Here's the error:
org.apache.lucene.queryParser.ParseException: Expected ',' at position 14 in

I confirmed that the problem occurs whenever a hyphen/minus/dash occurs in
the field name by putting in a fake field name:

undefined field MadeUpField

So, it looks like it is trying to parse the "-" in the field name as an
operator instead of as part of the field name.  Is it bad form to include a
hyphen in a field name... I've never had issues with it anywhere else in the
past.  FYI, I've confirmed this behavior on 1.4 nightly builds from both
6/16 and 8/6 and both forms of the function query syntax ({!func} and
_val_).  Also, I have this problem with seemingly all function queries (ord,
sum, etc.), not just "product."

Is there any way to escape the field name, or is this just a bug?

Any help you can provide would be greatly appreciated.  Thanks!

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