lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Todd Long <lon...@gmail.com>
Subject Atomic Update w/ Date Copy Field
Date Mon, 29 Aug 2016 13:42:40 GMT
We recently started using atomic updates in our application and have since
noticed that date fields copied to a text field have varying results between
full and partial updates. When the document is fully updated the copied text
date appears as expected (i.e. yyyy-MM-dd'T'HH:mm:ss.SSSZ); however, when
the document is partially updated (while omitting the date field) the
original stored date value is copied to a different format (i.e. EEE MMM d
HH:mm:ss z yyyy). I've included an example below of what we are seeing with
the indexed value of our "createdDate_facet_t" field. Is there a way that we
can force the copy field to always use "yyyy-MM-dd'T'HH:mm:ss.SSSZ" as the
resulting text format without having to always include the field in the
update?

schema
--------
<dynamicField name="*_dt" type="date" indexed="true" stored="true" />
<dynamicField name="*_t" type="text_general" indexed="true" stored="true"
omitNorms="true" />
<dynamicField name="*_facet_t" type="text_general" indexed="true"
stored="false" multiValued="true" 
omitNorms="true" />

<copyField source="*_dt" dest="*_facet_t" />

<fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100">
  <analyzer>
    <tokenizer class="solr.KeywordTokenizerFactory" />
    <tokenizer class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt" />
    <tokenizer class="solr.LowerCaseFilterFactory" />
  </analyzer>
</fieldType>

/update (full)
-------------
{
  "id": "12345",
  "createdBy_t": "someone",
  "createdDate_dt": "2015-07-14T12:58:17.535Z"
}

createdDate_facet_t = "2015-07-14t12:58:17.535z"

/update (partial)
----------------
{
  "id": "12345",
  "createdBy_t": { "set": "another" }
}

createdDate_facet_t = "tue jul 14 12:58:17 utc 2015"



--
View this message in context: http://lucene.472066.n3.nabble.com/Atomic-Update-w-Date-Copy-Field-tp4293779.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message