Can Curator filters documents during reindexation?


(fbonningues@partner.auchan.fr) #1

Hi,

I'm using curator for reindex daily indices into weekly/montly indices and it's work fine.

The current treatment takes all the documents and create the new index, but can curator excludes some documents (filter on a field value) or deletes some fields of a document ?

I managed to reindex with deletion of these specific documents/fields by the _reindex API, but I 'ld rather use curator to make this action.

Thanks for the answer
Best regards

François


(Aaron Mildenstein) #2

The answer to this is a resounding yes. Curator just uses YAML syntax to do anything that you can do with the regular reindex API.

For example, given this JSON reindex block:

POST _reindex
{
  "source": {
    "index": "twitter",
    "type": "_doc",
    "query": {
      "term": {
        "user": "kimchy"
      }
    }
  },
  "dest": {
    "index": "new_twitter"
  }
}

You would create a YAML request_body like this:

request_body:
  source:
    index: twitter
    type: _doc
    query:
      term:
        user: kimchy
  dest:
    index: new_twitter


(fbonningues@partner.auchan.fr) #3

Thanks a lot !


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.