Solr
  1. Solr
  2. SOLR-3495

UUID and Timestamp Update Processors

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      new Update Processor's to automatically add fields with new UUIDs and Timestamps to SolrInputDocuments leveraging SOLR-2802. Both processors should default to selecting the uniqueKey field if it is the appropriate type.

      This is necessary for 4.0 because of SOLR-2796

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          patch implementing 3 new UpdateProcessors, still needs javadocs...

            <updateRequestProcessorChain name="default-values">
              <processor class="solr.DefaultValueUpdateProcessorFactory">
                <str name="fieldName">processor_default_s</str>
                <str name="value">X</str>
              </processor>
              <processor class="solr.DefaultValueUpdateProcessorFactory">
                <str name="fieldName">processor_default_i</str>
                <int name="value">42</int>
              </processor>
              <processor class="solr.UUIDUpdateProcessorFactory">
                <str name="fieldName">uuid</str>
              </processor>
              <processor class="solr.TimestampUpdateProcessorFactory">
                <str name="fieldName">timestamp</str>
              </processor>
            </updateRequestProcessorChain>
          

          A few notes:

          • Doesn't actually leverage FieldMutatingUpdateProcessorFactory - that was a silly idea on my part since the whole point here is that there is not existing field in the SolrInputDocument to modify.
          • I didn't bother making the UUID/timestamps default to the uniqueKey field if the types made sense - "fieldName" is mandatory for all three processors. a) it seemed like it was going to be harder then i thought once i start looking into it. b) it doesn't gain us much for people migrating from using defaults on these in their schema.xml, because they'll still have to manually add these processors to their chain. (we can always add this as an improvement later if anyone is so inclined)
          Show
          Hoss Man added a comment - patch implementing 3 new UpdateProcessors, still needs javadocs... <updateRequestProcessorChain name="default-values"> <processor class="solr.DefaultValueUpdateProcessorFactory"> <str name="fieldName">processor_default_s</str> <str name="value">X</str> </processor> <processor class="solr.DefaultValueUpdateProcessorFactory"> <str name="fieldName">processor_default_i</str> <int name="value">42</int> </processor> <processor class="solr.UUIDUpdateProcessorFactory"> <str name="fieldName">uuid</str> </processor> <processor class="solr.TimestampUpdateProcessorFactory"> <str name="fieldName">timestamp</str> </processor> </updateRequestProcessorChain> A few notes: Doesn't actually leverage FieldMutatingUpdateProcessorFactory - that was a silly idea on my part since the whole point here is that there is not existing field in the SolrInputDocument to modify. I didn't bother making the UUID/timestamps default to the uniqueKey field if the types made sense - "fieldName" is mandatory for all three processors. a) it seemed like it was going to be harder then i thought once i start looking into it. b) it doesn't gain us much for people migrating from using defaults on these in their schema.xml, because they'll still have to manually add these processors to their chain. (we can always add this as an improvement later if anyone is so inclined)
          Hide
          Hoss Man added a comment -

          Committed revision 1344946. - trunk
          Committed revision 1344947. - 4x

          Show
          Hoss Man added a comment - Committed revision 1344946. - trunk Committed revision 1344947. - 4x

            People

            • Assignee:
              Hoss Man
              Reporter:
              Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development