On 3/26/2015 9:53 AM, Russell Taylor wrote: > I have an index which is made up of groups of documents, each group is > defined by a field called keyField (keyField:A). > I need to delete all the keyField:A documents and replace them with a brand > new set without the index ever returning > zero documents on a query. > > At the moment I deleteByQuery:keyField:A and then insert a SolrInputDocument > list via > SolrJ into my index. I have a small time period where somebody doing a > q=fieldKey:A > can be returned an empty list. > > FYI: The keyField group might be just 100 documents or up to 10 million.
As long as you don't have any commits with openSearcher=true happening between the delete and the insert, that would work ... but why go through the manual delete if you don't have to? If you define a suitable uniqueKey field in your schema, simply indexing a new document with the same value in the uniqueKeyfield as an existing document will delete the old document. https://wiki.apache.org/solr/UniqueKey Thanks, Shawn