mirror of https://github.com/apache/lucene.git
SOLR-13034: RTG sometimes didn't materialize LazyField (#2408)
Partial (AKA Atomic) updates could encounter "LazyField" instances in the document cache and not know hot to deal with them when writing the updated doc to the update log.
This commit is contained in:
parent
220db76311
commit
62971c4f99
|
@ -260,8 +260,13 @@ Optimizations
|
|||
Bug Fixes
|
||||
---------------------
|
||||
* SOLR-15078: Fix ExpandComponent behavior when expanding on numeric fields to differentiate '0' group from null group (hossman)
|
||||
|
||||
* SOLR-15149: Better exception handling for LTR model creation errors (Alessandro Benedetti, Christine Poerschke)
|
||||
|
||||
* SOLR-13034: Partial (AKA Atomic) updates could encounter "LazyField" instances in the document
|
||||
cache and not know hot to deal with them when writing the updated doc to the update log.
|
||||
(David Smiley)
|
||||
|
||||
|
||||
Other Changes
|
||||
---------------------
|
||||
|
|
|
@ -813,8 +813,9 @@ public class RealTimeGetComponent extends SearchComponent
|
|||
if ((!sf.hasDocValues() && !sf.stored()) || schema.isCopyFieldTarget(sf)) continue;
|
||||
}
|
||||
for (Object val: doc.getFieldValues(fname)) {
|
||||
if (val instanceof Field) {
|
||||
Field f = (Field) val;
|
||||
if (val instanceof IndexableField) {
|
||||
IndexableField f = (IndexableField) val;
|
||||
// materialize:
|
||||
if (sf != null) {
|
||||
val = sf.getType().toObject(f); // object or external string?
|
||||
} else {
|
||||
|
|
|
@ -1005,7 +1005,11 @@ public class AtomicUpdatesTest extends SolrTestCaseJ4 {
|
|||
|
||||
assertU(commit());
|
||||
|
||||
assertQ(req("q", "cat:*", "indent", "true"), "//result[@numFound = '2']");
|
||||
// note: by requesting only the id, the other field values will be LazyField instances in the
|
||||
// document cache.
|
||||
// This winds up testing that future fetches by RTG of this doc will handle it properly.
|
||||
// See SOLR-13034
|
||||
assertQ(req("q", "cat:*", "indent", "true", "fl", "id"), "//result[@numFound = '2']");
|
||||
assertQ(req("q", "cat:bbb", "indent", "true"), "//result[@numFound = '0']");
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue