You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Alexandre Rafalovitch (Jira)" <ji...@apache.org> on 2020/08/29 20:28:00 UTC

[jira] [Resolved] (SOLR-5809) Problem with xpath and attributes

     [ https://issues.apache.org/jira/browse/SOLR-5809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexandre Rafalovitch resolved SOLR-5809.
-----------------------------------------
    Resolution: Won't Fix

> Problem with xpath and attributes
> ---------------------------------
>
>                 Key: SOLR-5809
>                 URL: https://issues.apache.org/jira/browse/SOLR-5809
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 4.6
>            Reporter: Jan Mach
>            Priority: Critical
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> 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)  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org