On 4/22/2013 5:07 PM, Kalyan Kuram wrote:
Hi All I am new to solr and i wanted to know if i can export the Index as XML
and then re-index back into Solr, The reason i need to do this is i
misconfigured fieldtype and to make it work i need to re-index the content
The best option is to do the indexing again from whatever source you did
the index from the first time. Because your requirements may change at
any time, this is something that you should be prepared to do quite often.
If you did not set all fields to stored="true" in your schema, then you
will not be able to export all your documents from your current index to
a new one. There is no way around this, you will have to wipe your
index, go back to your original data source, and do the indexing again.
If you DID store all your fields, then you have two choices.
1) Use the dataimport handler with SolrEntityProcessor. You can use
this to import from one core onto another core on the same server with a
different config/schema, or from one server to another.
http://wiki.apache.org/solr/DataImportHandler#SolrEntityProcessor
2) I don't recommend this option, but it might work. You can query Solr
for your docs, one page at a time (use the rows and start parameters),
with wt=xml or wt=json, and save that output. With a little bit of
modification, you can then use what you save as input for indexing.
Here's a website describing the process and PHP script to make it
easier. I have not checked to see whether the script actually works,
and I won't be able to help you with it:
http://www.jason-palmer.com/2011/05/how-to-reindex-a-solr-database/
Thanks,
Shawn