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

GraphQuery not working for string fields that has only docValues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.6
    • 7.1, 8.0
    • query parsers
    • None

    Description

      Graph traversal is not working if string field has only docValues since the construction of leaf or parent node queries uses only TermQuery.

      managed-schema
      <schema name="graph" version="1.6">
          <field name="_version_" type="long" indexed="false" stored="false" docValues="true" />
          <field name="id" type="string" indexed="false" stored="false" docValues="true" />
          <field name="parentid" type="string" indexed="false" stored="false" docValues="true" />
          <field name="name" type="string" indexed="false" stored="false" docValues="true" />
      
          <uniqueKey>id</uniqueKey>
      
          <fieldType name="string" class="solr.StrField" sortMissingLast="true" />
          <fieldType name="long" class="solr.TrieLongField" docValues="true" precisionStep="0" positionIncrementGap="0"/>
      </schema>
      
      curl -XPOST -H 'Content-Type: application/json' 'http://localhost:8983/solr/graph/update' --data-binary ' {
       "add" : { "doc" : { "id" : "1", "name" : "Root1" } },
       "add" : { "doc" : { "id" : "2", "name" : "Root2" } },
       "add" : { "doc" : { "id" : "3", "name" : "Root3" } },
       "add" : { "doc" : { "id" : "11", "parentid" : "1", "name" : "Root1 Child1" } },
       "add" : { "doc" : { "id" : "12", "parentid" : "1", "name" : "Root1 Child2" } },
       "add" : { "doc" : { "id" : "13", "parentid" : "1", "name" : "Root1 Child3" } },
       "add" : { "doc" : { "id" : "21", "parentid" : "2", "name" : "Root2 Child1" } },
       "add" : { "doc" : { "id" : "22", "parentid" : "2", "name" : "Root2 Child2" } },
       "add" : { "doc" : { "id" : "121", "parentid" : "12", "name" : "Root12 Child1" } },
       "add" : { "doc" : { "id" : "122", "parentid" : "12", "name" : "Root12 Child2" } },
       "add" : { "doc" : { "id" : "131", "parentid" : "13", "name" : "Root13 Child1" } },
       "commit" : {}
      }'
      
      http://localhost:8983/solr/graph/select?q=*:*&fq={!graph from=parentid to=id}id:1
      or
      http://localhost:8983/solr/graph/select?q=*:*&fq={!graph from=id to=parentid}id:122
      

      Attachments

        1. SOLR-11190.patch
          4 kB
          Karthik Ramachandran
        2. SOLR-11190.patch
          4 kB
          Karthik Ramachandran
        3. SOLR-11190.patch
          5 kB
          Varun Thacker
        4. SOLR-11190.patch
          7 kB
          Karthik Ramachandran
        5. SOLR-11190.patch
          8 kB
          Varun Thacker
        6. SOLR-11190.patch
          8 kB
          Varun Thacker

        Issue Links

          Activity

            People

              mrkarthik Karthik Ramachandran
              mrkarthik Karthik Ramachandran
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: