0

I am trying to learn and implement Solr for a customer use case where we faced a question what if we need to add more fields(for storing and indexing) is it possible without re-indexing or reloading the data, and when I searched over the net for it and at most of the places it was given that while adding new field that need not to be indexed is okay and can be achieved but we want to add a new indexed field then we have to reload/reindex the data. But then there are dynamic fields in schema.xml which can be used to map to new fields whether they need to be indexed or just stored. My questions is: If that is a possible workaround to add new fields to existing data/index then why is is not suggested? is there any overhead associated with it or it's fine to use dynamic fields?

Agarwal
  • 5
  • 3

1 Answers1

0

Dynamic fields are there so Solr knows how to map your new content to the types. You would still need to reindex the actual documents.

Solr has API/format to partially update a document, so you only need to provide additional information, but under the covers that's still reindexing and you need to be careful that all fields are stored. If a field is store=false and you try partial reindexing, that value will disappear.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27
  • But is it okay if I am fine with the old data to remain as it was and just keep on indexing the new fields being added to schema via dynamic_filed? what I tried was like 1) I created a collection with 10 fields and 2 dynamic field and uploaded 100 docs to the collection later We modified the data and added to new two new fields namely abc_i and xyz_s in our new data and loaded that into collection and was able to search on abc_i and see xyz_s – Agarwal Aug 24 '15 at 08:14
  • Does solr does any reindexing internally for this situation? As I did not try this with a large data set I did not notice any delay or overhead. – Agarwal Aug 24 '15 at 08:20
  • Right. if store=true, you can roundtrip and add new fields. Solr will handling reconstructing the entry, adding new fields and storing it again updated internally. – Alexandre Rafalovitch Aug 24 '15 at 19:32