Adarsh created SOLR-16136:
-----------------------------

             Summary: How can i use deduplication with atomic update
                 Key: SOLR-16136
                 URL: https://issues.apache.org/jira/browse/SOLR-16136
             Project: Solr
          Issue Type: Wish
      Security Level: Public (Default Security Level. Issues are Public)
          Components: documentation
            Reporter: Adarsh


I am working on a requirment  where we are storing stacktraces in apache solr 
with datetime. Now if same stacktrace found again on another date then we want 
to record to be update with new date appended to the existing date. i have 
already marked my date field as multivalued.

Below is the configs :

<updateRequestProcessorChain name="dedupe">
  <processor class="solr.processor.SignatureUpdateProcessorFactory">
    <bool name="enabled">true</bool>
    <str name="signatureField">id</str>
    <str name="fields">logger,stacktrace</str>
    <bool name="overwriteDupes">true</bool>
    <str name="signatureClass">solr.processor.TextProfileSignature</str>
  </processor>
  <processor class="solr.LogUpdateProcessorFactory" />
  <processor class="solr.AtomicUpdateProcessorFactory">
    <str name="fields">dateTime</str> 
    </processor>
  <processor class="solr.RunUpdateProcessorFactory" />
    </updateRequestProcessorChain>
    
    <requestHandler name="/update" class="solr.UpdateRequestHandler" >
  <lst name="defaults">
    <str name="update.chain">dedupe</str>
  </lst>
</requestHandler>

 

schema.xml :

<field name="logger" type="string" multiValued="false" indexed="true" 
stored="true"/>
  <field name="stacktrace" type="text_general" multiValued="false" 
indexed="true" stored="true"/>
  <field name="dateTime" type="pdates" multiValued="true" indexed="false" 
stored="true"/>

 

code used :

UpdateRequest updateRequest = new UpdateRequest();
        updateRequest.setAction(UpdateRequest.ACTION.COMMIT, false, false);
        SolrInputDocument myDocumentInstantlycommited = new SolrInputDocument();
        Map<String,Object> fieldModifier = new HashMap<>(1);
        fieldModifier.put("add",date);
        myDocumentInstantlycommited. addField("dateTime", fieldModifier);
        myDocumentInstantlycommited.setField("logger", logger);
        myDocumentInstantlycommited.setField("stacktrace", stacktrace); 

 

Exception : Can't use SignatureUpdateProcessor with partial update request 
containing signature field: logger

  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to