Skip to Content
Apache Solr for Indexing Data
book

Apache Solr for Indexing Data

by Sachin Handiekar, Anshul Johri
December 2015
Intermediate to advanced content levelIntermediate to advanced
160 pages
2h 50m
English
Packt Publishing
Content preview from Apache Solr for Indexing Data

Indexing data using XPath

For simplicity, we'll use FileDataSource. With it, we can import data into Solr from XML files using XPathEntityProcessor to retrieve the data.

Let's go ahead and create a new core named MusicCatalogue-DIH-XPath in Solr. We can create the configuration files similarly to the ones we previously created for JDBCDataSource.

In solrconfig.xml, we'll use the following content:

  <requestHandler name="/dataimport" class="solr.DataImportHandler">
    <lst name="defaults">
      <str name="config">xpath-data-config.xml</str>
    </lst>
  </requestHandler>

We'll create a new file called xpath-data-config.xml, which will contain FileDataSource and XPathEntityProcessor:

<dataConfig> <!-- File Data Source --> <dataSource type="FileDataSource" encoding="UTF-8" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Scaling Apache Solr

Scaling Apache Solr

Hrishikesh Vijay Karambelkar
Mastering Apache Solr 7.x

Mastering Apache Solr 7.x

Sandeep Nair, Chintan Mehta, Dharmesh Vasoya
ElasticSearch Server

ElasticSearch Server

Rafal Kuc, Marek Rogozinski

Publisher Resources

ISBN: 9781783553235Supplemental Content