0

Documents can be added and removed any times. I need to remove some documents for historic storage.

Is it possible to select AND delete in the same request ?

  1. Select&delete data
  2. Store data somewhere else.
  3. Send commit.

Right now, I do :

  1. Select data with criteria + stats=true&stats.field=dateField
  2. Store data somewhere else.
  3. Query delete (with same criteria but using the getMax() value of dateField to not delete newer documents matching the request)
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
lleclerc
  • 653
  • 5
  • 10
  • 1
    Yeah, it's called "delete by query" http://stackoverflow.com/questions/8719860/how-to-delete-solr-indexed-data-by-query-with-curl – Geert-Jan May 24 '13 at 16:45
  • I don't think so. deleteByQuery() return UpdateResult. There is no results/documents other than it is success or not. – lleclerc May 24 '13 at 17:34
  • hmm misunderstood your question, sorry about that. No I don't believe you can do a select + delete at once. The flow you're suggesting seems the right way to go. – Geert-Jan May 25 '13 at 20:27

0 Answers0