Note that there are some explanatory texts on larger screens.

plurals
  1. POIndexing xml file into solr using XPathEntityProcessor - unable to index some tags
    text
    copied!<p>Using the <a href="http://wiki.apache.org/solr/DataImportHandler#Usage_with_XML.2FHTTP_Datasource" rel="nofollow">XPathEntityProcessor</a>, I am indexing following xml file (just an example):</p> <pre><code>&lt;shop&gt; &lt;vegitable&gt; .... &lt;/vegitable&gt; &lt;fruit&gt; &lt;property&gt; &lt;kind&gt;apple&lt;/kind&gt; &lt;value&gt;3.08&lt;/value&gt; &lt;from&gt;USA&lt;/from&gt; &lt;/property&gt; &lt;property&gt; &lt;kind&gt;banana&lt;/kind&gt; &lt;value&gt;8.5&lt;/value&gt; &lt;from&gt;CA&lt;/from&gt; &lt;/property&gt; &lt;property&gt; &lt;kind&gt;painaple&lt;/kind&gt; &lt;value&gt;102.8&lt;/value&gt; &lt;from&gt;CA&lt;/from&gt; &lt;/property&gt; &lt;/fruit&gt; .... .... .... &lt;/shop&gt; </code></pre> <p>I wish to store apple property in one field and all other properties into another field, so that i can use it for view purpose. Bellow is my solr-config.xml file, but solr doesn't process these 2 fields.</p> <pre><code>&lt;dataConfig&gt; &lt;dataSource type="FileDataSource" encoding="UTF-8" /&gt; &lt;document&gt; &lt;entity name="drug" processor="XPathEntityProcessor" stream="true" forEach="/shop/" url="/data/shop.xml" transformer="RegexTransformer,DateFormatTransformer" &gt; .... .... &lt;field column="apple-imported-form" xpath="/shop/fruit/property/[kind='apple']/from"/&gt; &lt;field column="apple-imported-value" xpath="/shop/fruit/property/[kind='apple']/value"/&gt; &lt;/entity&gt; &lt;/document&gt; &lt;/dataConfig&gt; </code></pre> <p>while reading document on <a href="http://wiki.apache.org/solr/DataImportHandler#Usage_with_XML.2FHTTP_Datasource" rel="nofollow">XPathEntityProcessor</a> on solr, i found following lines:</p> <blockquote> <p>The XPathEntityProcessor implements a streaming parser which supports a subset of xpath syntax. Complete xpath syntax is not supported but most of the common use cases are covered. </p> </blockquote> <p>But there is nothing mentioned about what things not covered while from Xpath. Please guide me.</p> <p>Thanks in advance!! </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload