You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Fergus McMenemie <fe...@twig.me.uk> on 2009/02/03 21:05:34 UTC
DIH, assigning multiple xpaths to the same solr field
Hello all,
Inside my DIH data-config.xml file I really wish to use an xpath
expression along the lines of "//para". However this is not allowed
so for the moment I am explicitly listing each of the different
xpaths and assigning them to a single solr field as follows:-
<entity name="x"
dataSource="myfilereader"
processor="XPathEntityProcessor"
url="${jc.fileAbsolutePath}"
stream="false"
forEach="/record">
<field column="para" xpath="/record/sect1/para" />
<field column="para" xpath="/record/list/listitem/para" />
<field column="para" xpath="/a/b/c/para" />
<field column="para" xpath="/d/e/f/g/para" />
Below is the line from my schema.xml
<field name="para" type="text" indexed="true" stored="true" multiValued="true"/>
Now a given document will only have one style of layout, and of course
the /a/b/c /d/e/f/g stuff is made up. For a document that has a single
<para>Hello world</para> element I see search results as follows, the
one <para> string seems to have been entered into the index four times.
I only saw duplicate results before adding the extra made-up stuff.
<