On Dec 14, 2008, at 6:15 AM, Noble Paul നോബിള്
नोब्ळ् wrote:
one xpath can be mapped to only one name.
That's a bizarre restriction. A shame.
If you want to copy one to another use something like a
TemplateTransformer
Thanks!, I got it to work like this:
<entity name="blog" pk="id" url="http://server/rss/"
processor="XPathEntityProcessor" forEach="/rss/channel/item"
transformer="TemplateTransformer">
<field column="id" xpath="/rss/channel/item/link"/>
<field column="url" template="${blog.id}"/>
<field column="title" xpath="/rss/channel/item/title"/>
<field column="description" xpath="/rss/channel/item/
description"/>
<!-- No pubDate either <field column="date" xpath="/rss/
channel/item/pubDate" dateTimeFormat="EEE, d MMM yyyy HH:mm:ss Z"/> -->
</entity>
A couple of questions... how would I add a static valued field in?
Something like:
<field column="source" value="blog"/>
where all documents from this entity come in with a source="blog"
literally.
Also, I want to add in date transformation like in the example above
commented out. How would I use both the TemplateTransformer and the
DateFormatTransformer, since I'm specifying the transformer on the
entity rather than the field it is used on? I don't yet understand
why the transformer is entity-based rather than per-field.
Thanks for your help, Noble.
Erik
On Sun, Dec 14, 2008 at 7:18 AM, Erik Hatcher
<e...@ehatchersolutions.com> wrote:
I'm trying to index a blog with DIH, and have this:
<field column="id" xpath="/rss/channel/item/link"/>
<field column="url" xpath="/rss/channel/item/link"/>
If I comment out the url <field> line it all works fine, but if I
put it in,
no documents get indexed. Is there an issue with using the same
xpath
twice? Or something else I'm missing?
This is using Solr trunk.
Thanks,
Erik
--
--Noble Paul