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

SelectStream only works with all lowercase field names and doesn't handle quoted selected fields

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0
    • Component/s: None
    • Labels:

      Description

      Three issues exist if one creates a SelectStream with an expression.

      select(
        search(collection1, fl="personId_i,rating_f", q="rating_f:*", sort="personId_i asc"),
        personId_i as personId,
        rating_f as rating
      )
      

      "personId_i as personId" will be parsed as "personid_i as personid"

      1. The incoming tuple will contain a field "personId_i" but the selection will be looking for a field "personid_i". This field won't be found in the incoming tuple (notice the case difference) and as such no field personId will exist in the outgoing tuple.

      2. If (1) wasn't an issue, the outgoing tuple would have in a field "personid" and not the expected "personId" (notice the case difference). This can lead to other down-the-road issues.

      3. Also, if one were to quote the selected fields such as in

      select(
        search(collection1, fl="personId_i,rating_f", q="rating_f:*", sort="personId_i asc"),
        "personId_i as personId",
        "rating_f as rating"
      )
      

      then the quotes would be included in the field name. Wrapping quotes should be handled properly such that they are removed from the parameters before they are parsed.

        Attachments

        1. SOLR-8485.patch
          4 kB
          Dennis Gove
        2. SOLR-8485.patch
          4 kB
          Dennis Gove
        3. SOLR-8485.patch
          2 kB
          Dennis Gove

          Activity

            People

            • Assignee:
              dpgove Dennis Gove
              Reporter:
              dpgove Dennis Gove
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: