Using Solr's XML format (Simple)

While CSV is perfectly an useful import format for Solr, it starts to get unwieldy very quickly. Fortunately, Solr supports a number of import formats. One of them is Solr's own update XML import format. It is more verbose than CSV, but you will see that it is easier to read and deals better with multivalued fields, optional fields, complex text strings, and other real-life requirements.

How to do it...

  1. Copy and rename the multivalued directory to a directory named xml and delete the data subdirectory in the new copy.
  2. Add another collection/core reference to solr.xml in the SOLR-INDEXING directory:
    <core name="xml" instanceDir="xml" />
  3. In schema.xml (under the xml/conf directory):

    a. Inside the fields section, add three ...

Get Instant Apache Solr for Indexing Data How-to now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.