I am looking for following solution in C#, Please provide sample code if
possible:-

1. Delete all the index using delete query.
2. Take backup of all the old index, before regenerate.
3. Try to write unlike query for a field to delete stale index.
4. How can use transaction under index generation (delete all old index and
generate index), so that if any error occurs than it will not affect old
indexes.





ryantxu wrote:
> 
> escher2k wrote:
>> I am trying to remove documents from my index using "delete by query".
>> However when I did this, the deleted
>> items seem to remain. This is the format of the XML file I am using -
>> 
>> <delete><query>load_id:20070424150841</query></delete>
>> <delete><query>load_id:20070425145301</query></delete>
>> <delete><query>load_id:20070426145301</query></delete>
>> <delete><query>load_id:20070427145302</query></delete>
>> <delete><query>load_id:20070428145301</query></delete>
>> <delete><query>load_id:20070429145301</query></delete>
>> 
>> When I do the deletes individually, it seems to work (i.e. create each of
>> the above in a separate file). Does this
>> mean that each delete query request has to be executed separately ?
>> 
> 
> correct, delete (unlike <add>) only accepts one command.
> 
> Just to note, if "load_id" is your unique key, you could also use:
>   <delete><id>20070424150841</id></delete>
> 
> This will give you better performance and does not commit the changes 
> until you explicitly send <commit/>
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Delete-from-Solr-index...-tp10264940p27369849.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to