lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trey (JIRA)" <>
Subject [jira] Commented: (SOLR-1172) Hyphenation in Query Boost Function
Date Wed, 19 Aug 2009 23:36:14 GMT


Trey commented on SOLR-1172:

I've encountered this issue in another context.  It is being caused by invalid parsing of
Function Queries:

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

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

Here's the error:
org.apache.lucene.queryParser.ParseException: Expected ',' at position 14 in 'product(rank_i,2)'

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

> Hyphenation in Query Boost Function
> -----------------------------------
>                 Key: SOLR-1172
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>          Components: search
>    Affects Versions: 1.3
>         Environment: Windows, PC
>            Reporter: Yao Ge
> I have a field named "last-modified" that I like to use in bf (Boot
> Functions) parameter: recip(rord(last-modified),1,1000,1000)  in DisMaxRequestHander.
> However the Solr query parser complain about the syntax of the formula. 
> {quote}
> The request sent by the client was syntactically incorrect (org.apache.lucene.queryParser.ParseException:
Expected identifier at pos 11 str='recip(rord("last-modified"),1,1000,1000)').
> {quote}
> {code}
> SEVERE: org.apache.solr.common.SolrException: org.apache.lucene.queryParser.ParseException:
Expected identifier at pos 11 str='recip(rord("last-modified"),1,1000,1000)'
>         at org.apache.solr.handler.component.QueryComponent.prepare(
>         at org.apache.solr.handler.component.SearchHandler.handleRequestBody(
>         at org.apache.solr.handler.RequestHandlerBase.handleRequest(
>         at org.apache.solr.core.SolrCore.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.execute(
>         at org.apache.solr.servlet.SolrDispatchFilter.doFilter(
>         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>         at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>         at org.apache.catalina.core.StandardWrapperValve.invoke(
>         at org.apache.catalina.core.StandardContextValve.invoke(
>         at org.apache.catalina.core.StandardHostValve.invoke(
>         at org.apache.catalina.valves.ErrorReportValve.invoke(
>         at org.apache.catalina.core.StandardEngineValve.invoke(
>         at org.apache.catalina.connector.CoyoteAdapter.service(
>         at org.apache.coyote.http11.Http11Processor.process(
>         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
>         at$
>         at Source)
> Caused by: org.apache.lucene.queryParser.ParseException: Expected identifier at pos 11
>         at$StrParser.getId(
>         at
>         at$2.parse(
>         at
>         at
>         at$5.parse(
>         at
>         at
>         at
>         at
>         at
>         at org.apache.solr.handler.component.QueryComponent.prepare(
>         ... 17 more
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message