lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hoss Man (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-2335) FunctionQParser can't handle fieldnames containing whitespace
Date Sat, 02 Apr 2011 01:22:06 GMT

     [ https://issues.apache.org/jira/browse/SOLR-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hoss Man updated SOLR-2335:
---------------------------

    Description: 
FunctionQParser has some simplistic assumptions about what types of field names it will deal
with, in particular it can't deal with field names containing whitespaces.


  was:
We use an external file field configured as dynamic field. The dynamic field name (and so
the name of the provided file) may contain spaces. But currently it is not possible to query
for such fields. The following query results in a ParseException:
q=_val_:(experience_foo\ bar)

org.apache.lucene.queryParser.ParseException: Cannot parse '_val_:(experience_foo\ bar)':
Expected ',' at position 15 in 'experience_foo bar'

We use following configuration for the externalFileField:
  <types>
    ...
    <fieldType name="experienceRankFile" keyField="id" defVal="0" stored="false" indexed="false"
class="solr.ExternalFileField"
                 valType="float"/>
  </types>
  <fields>
    <dynamicField name="experience_*" type="experienceRankFile" />
    ...
  </field>


        Summary: FunctionQParser can't handle fieldnames containing whitespace  (was: External
file field name containing whitespace not supported)

Updating summary/description based on root of problem.

Description form original bug reporter...

{quote}
We use an external file field configured as dynamic field. The dynamic field name (and so
the name of the provided file) may contain spaces. But currently it is not possible to query
for such fields. The following query results in a ParseException:
q=_val_:(experience_foo\ bar)

org.apache.lucene.queryParser.ParseException: Cannot parse '_val_:(experience_foo\ bar)':
Expected ',' at position 15 in 'experience_foo bar'

We use following configuration for the externalFileField:
  <types>
    ...
    <fieldType name="experienceRankFile" keyField="id" defVal="0" stored="false" indexed="false"
class="solr.ExternalFileField"
                 valType="float"/>
  </types>
  <fields>
    <dynamicField name="experience_*" type="experienceRankFile" />
    ...
  </field>
{quote}


The original reasons for these assumptions in FunctionQParser are still generally good: it
helps keep the syntax and the parsing simpler then they would otherwise need to be.

I think an easy improvement we could make is to leave the current parsing logic the way it
is, but provide a new "FieldValueSourceParaser" that expects a single (quoted) string as input,
and just returns the FieldValueSource for that field.

So these two would be equivilent...

{code}
{!func}myFieldName
{!func}field("myFieldName")
{code}

...but it would also be possible to write...

{code}
{!func}field("1 my wacky Field*Name")
{code}


> FunctionQParser can't handle fieldnames containing whitespace
> -------------------------------------------------------------
>
>                 Key: SOLR-2335
>                 URL: https://issues.apache.org/jira/browse/SOLR-2335
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 1.4.1
>            Reporter: Miriam Doelle
>            Priority: Minor
>
> FunctionQParser has some simplistic assumptions about what types of field names it will
deal with, in particular it can't deal with field names containing whitespaces.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message