How to limit the amount of submitted documents?


(brand0m) #1

hello,

in my project I have (index and type): test_index/rare_events structure.
those rare_events are submitted to ES very rarely and generally I would
like to store for instance only last 10 of them. how to limit in ES the amount
of documents during mapping creation for rare_events type? what is the
correct approach? thanks in advance for all hints

--
brand0m


(Mark Walkom) #2

The only approach is for you to handle that, there is no way for ES to do it.


(brand0m) #3

ok, I see. what about blocking write operations for rare_events type? is it possible in ES to set a kind of "read only" mode for particular type?


(Mark Walkom) #4

No, only for an index.


(brand0m) #5

ok, I see. would it be reasonable to request such features?

  1. set limit for documents per type
  2. allow to switch between rw/ro modes for particular types
    what do you think? :slightly_smiling:

(Mark Walkom) #6

1, maybe but only for an index.
2, no. Chances are types will be removed at some point in the future, there are some large changes to them in 2.X that prevent mixing different types in a single index.


(brand0m) #7

hmmm... what about handling those two cases by some scripts on ES side? this should be possible (I hope)


(Mark Walkom) #8

Maybe, but I can't help with that sorry, it's not my area.


(brand0m) #9

thanks for help anyway


(system) #10