On 3/27/2015 7:07 AM, Russell Taylor wrote:
> Hi Shawn, thanks for the quick reply.
> 
> I've looked at both methods and I think that they won't work for a number of 
> reasons:
> 
> 1)
> uniqueKey:
>  I could use the uniqueKey and overwrite the original document but I need to 
> remove the documents which 
> are not on my new input list and the issue with the uniqueKey method is I 
> don't know what to delete.
> 
> Documents on the index:
> "docs": [
> {
> "id":"1"
> "keyField":"A"
> },{
> "id":"2"
> "keyField":"A"
> },{
> "id":"3"
> "keyField":"B"
> }
> ]
> New Documents to go on index
> "docs": [
> {
> "id":"1"
> "keyField":"A"
> },{
> "id":"3"
> "keyField":"B"
> }
> ]
> I would never know that id:2 should be deleted. (on some new document lists 
> the delete list could be in the millions).
> 
> 2)
> openSearcher:
> My openSearcher is set to false and I've also commented out autoSoftCommit so 
> I don't get a partial list being returned on a query.
> <!--
> <autoSoftCommit>
>        <maxTime>${solr.autoSoftCommit.maxTime:1000}</maxTime>
> </autoSoftCommit>
> -->
> 
> 
> So is there another way to keep the original set of documents until the new 
> set has been added to the index?

If you are 100% in control of when commits with openSearcher=true are
sent, which it sounds like you probably are, then you can do anything
you want from the start of indexing until commit time, and the user will
never see any of it, until the commit happens.  That allows the
following relatively simple paradigm:

1) Delete LOTS of stuff, or perhaps everything in the index with a
deleteByQuery of *:* (for all documents).

2) Index everything you need to index.

3) Commit.

Thanks,
Shawn

Reply via email to