Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Batch delete for items older than an expiration date.

Received: by 10.224.184.70 with SMTP id cj6mr4764917qab.3.1336217308012;
        Sat, 05 May 2012 04:28:28 -0700 (PDT)
X-BeenThere: ravendb@googlegroups.com
Received: by 10.229.106.227 with SMTP id y35ls801014qco.8.gmail; Sat, 05 May
 2012 04:28:25 -0700 (PDT)
Received: by 10.224.173.195 with SMTP id q3mr87861qaz.0.1336217305673;
        Sat, 05 May 2012 04:28:25 -0700 (PDT)
Received: by 10.224.21.143 with SMTP id j15msqab;
        Fri, 4 May 2012 09:56:44 -0700 (PDT)
Received: by 10.52.31.42 with SMTP id x10mr260394vdh.7.1336150604786;
        Fri, 04 May 2012 09:56:44 -0700 (PDT)
Date: Fri, 4 May 2012 09:56:44 -0700 (PDT)
From: Miguel Ludert <mig...@thinkingsitesinc.com>
To: ravendb@googlegroups.com
Message-ID: <579263.1442.1336150604074.JavaMail.geo-discussion-forums@vbx14>
Subject: Batch delete for items older than an expiration date.
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1440_23917179.1336150604073"

------=_Part_1440_23917179.1336150604073
Content-Type: multipart/alternative; 
	boundary="----=_Part_1441_27487237.1336150604073"

------=_Part_1441_27487237.1336150604073
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

I'm still working to get the hang of Lucene and am not sure how to 
structure this query.

I'm trying to delete all items older than a certain date.  It seems I have 
to do a range query, yes?  What format do I use for the dates?

            _Session.Advanced.DatabaseCommands.DeleteByIndex(
                typeof(AssetsByExpirationDate).Name,
                new IndexQuery()
                {
                    Query = 
string.Format("ExpirationDate:[\"{0:MM/dd/yyyy}\" TO \"{1:MM/dd/yyyy}\"]", 
DateTime.MinValue, new DateTime(2012,6,1))
                });

Any guidance on this topic would be appreciated.

------=_Part_1441_27487237.1336150604073
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

I'm still working to get the hang of Lucene and am not sure how to structure this query.<div><br></div><div>I'm trying to delete all items older than a certain date. &nbsp;It seems I have to do a range query, yes? &nbsp;What format do I use for the dates?</div><div><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _Session.Advanced.DatabaseCommands.DeleteByIndex(</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; typeof(AssetsByExpirationDate).Name,</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new IndexQuery()</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Query = string.Format("ExpirationDate:[\"{0:MM/dd/yyyy}\" TO \"{1:MM/dd/yyyy}\"]", DateTime.MinValue, new DateTime(2012,6,1))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });</div></div><div><br></div><div>Any guidance on this topic would be appreciated.</div>
------=_Part_1441_27487237.1336150604073--

------=_Part_1440_23917179.1336150604073--