lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hans-Peter Stricker" <stric...@epublius.de>
Subject Re: Problem with xpath expression in data-config.xml
Date Thu, 30 May 2013 07:55:30 GMT
Thanks for having analyzed the problem. But please let me note that I came to a somehow different
conclusion.

Define for the moment "title" to be the primary unique key: 

solr-4.3.0\example\example-DIH\solr\rss\conf\schema.xml

<uniqueKey>title</uniqueKey> 

solr-4.3.0\example\example-DIH\solr\rss\conf\rss-data-config.xml

[BAD CASE] (irrespective of the predicate @rel='self')
<dataConfig>
    <dataSource type="URLDataSource" />
    <document>
        <entity name="beautybooks88 " pk="title" url="http://beautybooks88.blogspot.com/feeds/posts/default"
processor="XPathEntityProcessor" forEach="/feed/entry" transformer="DateFormatTransformer">
            <field column="title" xpath="/feed/entry/title" />
            <field column="source-link" xpath="/feed/link[@rel='self']/@href" commonField="true"
/>
        </entity>
    </document>
</dataConfig>

[GOOD CASE]
<dataConfig>
    <dataSource type="URLDataSource" />
    <document>
        <entity name="beautybooks88 " pk="title" url="http://beautybooks88.blogspot.com/feeds/posts/default"
processor="XPathEntityProcessor" forEach="/feed/entry" transformer="DateFormatTransformer">
            <field column="title" xpath="/feed/entry/title" />
            <field column="link" xpath="/feed/entry/link[@rel='self']/@href" />
        </entity>
    </document>
</dataConfig>

Conclusion: It has nothing to do with the number of occurrences of the pattern.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message