1
votes

I have in schema (Solr 5.1):

<field name="category" type="tint" indexed="true" stored="true"  
       multiValued="false" docValues="true" />

I want:

<field name="category" type="tint" indexed="true" stored="true" 
       multiValued="true" docValues="true" />

Can I update field to multiValued="true" without reindex all index? The structure index will be valid after the upgrade?

1
You can update filed definition multiValued=true using schema API. but you have to reindex docs, you can also check with partial update of document(updating a single field in the index). - Vinod

1 Answers

0
votes

Basically, you could try to just change schema without reindexing, but that could cause nasty errors.

Quote from the official Solr guide:

When modifying the schema with the API, a core reload will automatically occur in order for the changes to be available immediately for documents indexed thereafter. Previously indexed documents will not be automatically updated - they must be re-indexed if existing index data uses schema elements that you changed.

If you modify your schema, you will likely need to re-index all documents. If you do not, you may lose access to documents, or not be able to interpret them properly, e.g. after replacing a field type. Modifying your schema will never modify any documents that are already indexed. You must re-index documents in order to apply schema changes to them. Queries and updates made after the change may encounter errors that were not present before the change. Completely deleting the index and rebuilding it is usually the only option to fix such errors.