Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@id and UUID #15

Open
zafarale opened this issue May 6, 2020 · 1 comment
Open

@id and UUID #15

zafarale opened this issue May 6, 2020 · 1 comment

Comments

@zafarale
Copy link

zafarale commented May 6, 2020

Hi I am trying to use Solr for my use case where UUID is used as identifier;

Hence i my code is ass follows

@org.springframework.data.annotation.Id //@Field("id") //@Indexed(type = "java.util.UUID", name = "id") @Indexed(type = "solr.UUIDField", name = "id") private UUID uid;
and solr Schema is as follows
<uniqueKey>id</uniqueKey> <fieldType name="uuid" class="solr.UUIDField" sortMissingLast="true" /> <field name="id" type="uuid" indexed="true" stored="true" required="true" multiValued="false" />

I tied to configure solr as;

  `<updateRequestProcessorChain name="uuid">
    <processor class="solr.UUIDUpdateProcessorFactory">
      <str name="fieldName">id</str>
    </processor>
    <processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
 <requestHandler name="/update" class="solr.UpdateRequestHandler">
      
       <lst name="defaults">
         <str name="update.chain">uuid</str>
       </lst>
      
</requestHandler>`

Which failed as Solr doe nto return UUID on Update. now i am trying to send UUID with update request and was responded back with ;

org.apache.solr.common.SolrException: Invalid UUID String: 'org.apache.solr.common.SolrInputField:id=e550e68b-ddbb-4d15-be95-69ff38343ba2'

Can you suggest what is possible solution

@najeebdata
Copy link

I have the same issue where-in while saving documents. Did anyone find a solution/workaround to this issue

Caused by: org.apache.solr.common.SolrException: Invalid UUID String: 'org.apache.solr.common.SolrInputField:id=3bdc3780-0613-11e3-8ffd-0800200c9a66' at org.apache.solr.schema.UUIDField.toInternal(UUIDField.java:88) at org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:409) at org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:417) at org.apache.solr.update.AddUpdateCommand.getIndexedId(AddUpdateCommand.java:130) at org.apache.solr.update.processor.DistributedUpdateProcessor.versionAdd(DistributedUpdateProcessor.java:277) at org.apache.solr.update.processor.DistributedUpdateProcessor.processAdd(DistributedUpdateProcessor.java:223) at org.apache.solr.handler.loader.JavabinLoader$1.update(JavabinLoader.java:110) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readOuterMostDocIterator(JavaBinUpdateRequestCodec.java:327) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readIterator(JavaBinUpdateRequestCodec.java:280) at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:336) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:281) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec$StreamingCodec.readNamedList(JavaBinUpdateRequestCodec.java:235) at org.apache.solr.common.util.JavaBinCodec.readObject(JavaBinCodec.java:301) at org.apache.solr.common.util.JavaBinCodec.readVal(JavaBinCodec.java:281) at org.apache.solr.common.util.JavaBinCodec.unmarshal(JavaBinCodec.java:194) at org.apache.solr.client.solrj.request.JavaBinUpdateRequestCodec.unmarshal(JavaBinUpdateRequestCodec.java:126) at org.apache.solr.handler.loader.JavabinLoader.parseAndLoadDocs(JavabinLoader.java:123) at org.apache.solr.handler.loader.JavabinLoader.load(JavabinLoader.java:70) at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:97) at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:68) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199) at org.apache.solr.core.SolrCore.execute(SolrCore.java:2578) at com.rivermeadow.config.CustomEmbeddedSolrServer.request(CustomEmbeddedSolrServer.java:110) at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:211) at org.apache.solr.client.solrj.SolrClient.add(SolrClient.java:177) at org.springframework.data.solr.core.SolrTemplate.lambda$saveDocument$4(SolrTemplate.java:233) at org.springframework.data.solr.core.SolrTemplate.execute(SolrTemplate.java:167) at org.springframework.data.solr.core.SolrTemplate.saveDocument(SolrTemplate.java:233) at org.springframework.data.solr.core.SolrOperations.saveDocument(SolrOperations.java:182)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants