There's nothing built into Solr that lets you do this automatically. About
the best you can do is probably a delete by query going back some fixed
time interval. So rather than keeping the last N documents, you keep
documents that are, say, no more than 1 month old (or whatever you
determine your interval is that allows you to keep around 1M docs
around).

Then you'd have to monitor this on a running system to see how close
you were to your target numbers....

Best
Erick

On Sun, Nov 13, 2011 at 1:23 PM, mikr00 <kruppa.mich...@gmail.com> wrote:
> Hi Yury,
>
> thank you very much for your quick reply. Currently I have a timestamp field
> (solr.DateField) and every time I add a document I use "NOW" for the
> timestamp field. I only commit documents on the core every four hours. This
> works fine with the timestamp since I can use "NOW". However, I couldn't
> figure out, how to define some kind of auto-increment for a particular
> field. I think I can't handle this from outside since I can have several
> adds in parallel from different clients. So I was wondering, whether there
> could be a field type that could actually automatically increase it's value
> for each added (commited) document? So that I could use a placeholder like
> "NOW" in the case of the DateField to indicate that I would like to
> auto-increment the field.
>
> Cheers
>
> Michael
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Delete-by-Query-with-limited-number-of-rows-tp3503094p3504924.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to