Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2815

Fields with a "-" in the name are interpreted as functions in the fl= parameter.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.0-ALPHA
    • None
    • search
    • None
    • Using latest from trunk

    Description

      If you query for a field that has a "-" character in the name, you get odd results. I took the example schema and added a field called "in-stock" to go along with the existing "inStock" field.

      A query for http://localhost:8983/solr/select?q=*:*&fl=id,in-stock throws back an error saying the field "in" can't be found.

      I can sort of work around it by quoting the field name as "in-stock":

      http://localhost:8983/solr/select?q=*:*&fl=id,%22in-stock%22&rows=1

      However the output is still off:

      <doc>
      <str name="id">GB18030TEST</str>
      <str name=""in-stock"">in-stock</str>
      </doc>

      In looking at it, I think the dash character causes the field name to be interpreted as an actual function!

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              epugh Eric Pugh
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: