lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Heisey <apa...@elyograg.org>
Subject Re: Update documents cause multivalue fields unexpected behaviour
Date Tue, 07 May 2019 13:32:37 GMT
On 5/7/2019 5:45 AM, Jie Luo wrote:
> For the fields that are set as stored true,  query works fine, but for fields that are
set as stored false, the query does not work after the documents are updated.
> 
> SolrInputDocument solrInputDocument = new SolrInputDocument();
> 		solrInputDocument.addField(“id”,”somevalidId”);
> 
> Map<String, Object> fieldModifier = new HashMap<>(1);
> 			fieldModifier.put("set", “some value");
> 			solrInputDocument.addField(“aNewField", fieldModifier);

What you are doing there (using the "set" keyword in a Map object) is 
known as an Atomic Update.  That feature has some very strict 
requirements, and by setting "stored" on your field, you are violating 
those requirements.

In your schema, only copyField destinations can be stored=false.  In 
fact, those HAVE to be stored=false.  Everything else will need to have 
data retrievable in search results.

Here is a fuller description of what Atomic Updates requires:

https://lucene.apache.org/solr/guide/7_7/updating-parts-of-documents.html#field-storage

Side note, the relevance will make sense once you've read that entire 
section of the ref guide: Some field classes (TextField in particular) 
do not support docValues.

Thanks,
Shawn

Mime
View raw message