Can a unique key in Solr/Lucene schema be text_general instead? I have tried that but Solr doesn’t overwrite the data, it simply adds another row hence duplicating the data.
I have commented out following from solrconfig.xml
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>
My schema.xml has
<uniqueKey>_id</uniqueKey>
<field name="_id" type="text_general" indexed="true" stored="true" default="NEW"/>
Any help would be greatly appreciated.
You can use whatever type you want for the
uniqueKeyfield. As you can read from the documentation:What’s important is that your uniqueKey field is unique, meaning that the same document has the same identifier. Only that way the replace if existing mechanism can work. Using an uuid field type you’d never replace a document because you would have a different id for each one, automatically.