Hello,

I have a schema with some date field and some long fields: (example)

<field name="created_at" type="date" indexed="true" required="true" 
stored="false" docValues="true"/>
<field name="edited_at" type="date" indexed="true" required="false" 
stored="false" docValues="true"/>
<dynamicField name="*_count" type="long" indexed="true" stored="false" 
docValues="true"/>
Some of the documents might be modified and what I’d like to do is replace the 
document in the index IF any of the *_count values are greater than what is in 
Solr already or if the edited_at value is greater than the created_at or 
greater than the previous edited_at value. At the moment what I’m doing is 
inserting a document with _version_ = -1 and if I get an error then I get the 
document, do the checks I’ve explained in the application, and reindex if I 
need to. I’m curious to know if this is something I can push down to Solr? 
Doing 2 searches and 2 PUTs per document that is modified seems a bit excessive.

Many thanks for the help.

-Cesar 

Reply via email to