It's also often not a good idea to use a generated UUID as a document ID because if the corpus is ever re-indexed (to accept new schema changes, or for upgrade to a new major version for example) all the document id's will change and any users or software trying to act on the prior id's will have difficulty. Furthermore if the same document is ever sent twice you will have two copies in the index which is rarely desirable and more or less defies the notion of identity in the first place.
Whenever possible, it is better to generate and store the id in your system of record. Generating a new id at index time means you can never update a document with revised information. So hopefully if you are using this you have verified that you never need to update documents and that nobody will ever try to remember the ID of any document outside of Solr and try to fetch it later. -Gus On Fri, Apr 12, 2024 at 7:49 PM Beale, Jim (US-KOP) <jim.be...@hibu.com.invalid> wrote: > You have uuid in the solrconfig.xml but id in the managed-schema. > > > > > On 4/12/24, 11:50 AM, "David Driver" <david.dri...@enactor.co.uk <mailto: > david.dri...@enactor.co.uk>> wrote: > > > I'm currently updating a Solr instance from 5.5 to 9.4 (and to solr cloud). > More precisely, I'm starting with base config files from 9.4 and updating > it to be equivalent to one used for 5.5 > > > However, I have run into an issue with the unique key, and I cannot see > what the issue is. We expect the id to be generated if not provided in the > document, yet documents without ids are instead (on 9.4) complaining about > the id being missing. > > > In the solr config: > > > <updateProcessor class="solr.UUIDUpdateProcessorFactory" name="uuid"/> > > > <updateRequestProcessorChain name="add-unknown-fields-to-the-schema" > default > ="${update.autoCreateFields:false}" > > > processor="uuid > > ,version-check,timestamp,remove-blank,parse-boolean,parse-long,parse-double,parse-date,maxPrice,minPrice" > > > > > <processor class="solr.LogUpdateProcessorFactory"/> > > > <processor class="solr.DistributedUpdateProcessorFactory"/> > > > <processor class="solr.RunUpdateProcessorFactory"/> > > > </updateRequestProcessorChain> > > > In the managed-schema: > > > <field name="id" type="string" indexed="true" stored="true" required="true" > multiValued="false" /> > > > <uniqueKey>id</uniqueKey> > > > As far as I can tell, that is all standard. So why isn't the unique key > being generated? > > > Regards > David Driver > > > > The information contained in this email message, including any > attachments, is intended solely for use by the individual or entity named > above and may be confidential. If the reader of this message is not the > intended recipient, you are hereby notified that you must not read, use, > disclose, distribute or copy any part of this communication. If you have > received this communication in error, please immediately notify me by email > and destroy the original message, including any attachments. Thank you. > **Hibu IT Code:1414593000000** > -- http://www.needhamsoftware.com (work) https://a.co/d/b2sZLD9 (my fantasy fiction book)