How to index wikipedia files in .xml format into s

2019-09-12 21:33发布

问题:

I want to index xml files of Wikipedia into Solr.

But I am getting an error, it is unable to index. Solr has a specific format for xml files. I changed the schema.xml and data-config.xml files to suit the tags of the wikipedia files.

Still it is unable to index the files. My actual intention is to index wikipedia which is an xml file of 30 GB.

How would I go about indexing all wikipedia files into Solr?

回答1:

There's an example section in the DataImportHandler documentation for exactly this: indexing Wikipedia.

Basically, you use the DataImportHandler and some XPath to pull the metadata you care about out of the Wikipedia XML, and put it in flat Solr field listings.