Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16136

How can i use deduplication with atomic update

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • documentation
    • None

    Description

      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

        

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            adarshh Adarsh

            Dates

              Created:
              Updated:

              Slack

                Issue deployment