You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Jan Mach (JIRA)" <ji...@apache.org> on 2014/03/04 23:09:42 UTC
[jira] [Commented] (SOLR-5809) Problem with xpath and attributes
[ https://issues.apache.org/jira/browse/SOLR-5809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920103#comment-13920103 ]
Jan Mach commented on SOLR-5809:
--------------------------------
There is probably a relation with an issue https://issues.apache.org/jira/browse/SOLR-4875
> 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
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org