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

Solr SQL does not return documents for 'AND' operation on multi-valued field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 8.11.1
    • 9.0, 8.11.2
    • Parallel SQL

    Description

      SolrSQL fails if `AND` operation is performed on multi-valued field in Solr

      Data

       

      [{
              "name_s":"Foo",
              "cities_ss":["SFO",
                "NYC"],
              "userid_i":1,
              "id":"1"},
            {
              "name_s":"Bar",
              "cities_ss":["SEA",
                "LA"],
              "userid_i":2,
              "id":"2"}] 

      Sql query

       

      select name_s, cities_ss FROM sql_test WHERE cities_ss IN ('SFO') AND cities_ss IN ('NYC') 

      The above query returns no documents even though a match exists in Solr

      Similar query (below) returns no documents

      select name_s, cities_ss FROM sql_test WHERE cities_ss='SFO' and cities_ss='NYC' 

      Multi-valued support in SQL is messy but it would be good to get support for this as filtering on multi-valued fields are quite common in Solr

      This is probably a bug in Calcite giving precedence to some default rules

       

       

      Attachments

        Activity

          People

            thelabdude Timothy Potter
            kiranch Kiran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 40m
                1h 40m