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

Problem with xpath and attributes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Won't Fix
    • 4.6
    • None
    • None

    Description

      There is a strange behavior, when I use in XPathEntityProcessor, in xpath for multiple fields, rules with attributes for the same tag or when I would like to select the same tag in xpath twice.

      My XML looks like:

      <?xml version="1.0" encoding="utf-8"?>
      <metadata>
      <id>1</id>

      <fileProperties fileType="a">a.pdf</fileProperties>
      <fileProperties fileType="b">b.pdf</fileProperties>
      <fileProperties fileType="c">c.pdf</fileProperties>
      </metadata>

      What works fine:
      <field column="test_value" xpath="/metadata/fileProperties" multiValued="true" />
      <field column="test_fileType" xpath="/metadata/fileProperties/@fileType" multiValued="true" />
      The result:
      test_value="a.pdf","b.pdf","c.pdf" (correct)
      test_fileType="a","b","c" (correct)

      What is wrong 1):
      When I add a new column (test_fileID) with selecting with an attribute, test_value and test_fileType have wrong values.
      <field column="test_fileID" xpath="/metadata/fileProperties[@fileType='a']/@fileType" />
      <field column="test_value" xpath="/metadata/fileProperties" />
      <field column="test_fileType" xpath="/metadata/fileProperties/@fileType" />
      The result:
      test_fileID="a" (correct)
      test_value="b.pdf","c.pdf" (missing "a.pdf")
      test_fileType="b","c" (missing "a")

      What is wrong 2):
      I cannot select the same field value twice.
      <field column="test_one" xpath="/metadata/fileProperties" multiValued="true"/>
      <field column="test_two" xpath="/metadata/fileProperties]" multiValued="true"/>
      The result:
      test_one: (the field is missing, should be "a.pdf","b.pdf","c.pdf")
      test_two: "a.pdf","b.pdf","c.pdf" (correct)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              machj Jan Mach
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified