Thanks kan for your prompt help. It is really a great solution to recovery
those deleted records.

Another question is about Solr history data housekeep problem. the scenario
is as below:

we have a solr core to store biz records, which is large volume that the
index files is more than 50GB in one month. Due to disk space limitation,
we need to delete one month ago records from solr.  but in the other hand,
we need to keep those data in the cheaper disk for analysis.
the problem is how to keep those data one month ago into cheaper disk in
quickly solution. one simple but so slow solution is that we search out
those records and add into the solr in the cheaper disk.

wanna to know is there any other solution for such kind of problem. e.g.
move the index files directly?

thanks a lot!

On Wed, Oct 17, 2012 at 12:31 AM, Dmitry Kan <dmitry....@gmail.com> wrote:

> Hello,
>
> One approach (not a solrish one, but still) would be to use Lucene API and
> set up an IndexReader onto the solr index in question. You can then do:
>
> [code]
> Directory indexDir = FSDirectory.open(new File(pathToDir));
> IndexReader input = IndexReader.open(indexDir, true);
>
> FieldSelector fieldSelector = new SetBasedFieldSelector(
>                 null, // to retrive all stored fields
>                 Collections.<String>emptySet());
>
> int maxDoc = input.maxDoc();
> for (int i = 0; i < maxDoc; i++) {
> if (input.isDeleted(i)) {
> // deleted document found, retrieve it
> Document document = input.document(i, fieldSelector);
> // analyze its field values here...
> }
> }
> [/code]
>
> I haven't compiled this code myself, you'll need to experiment with it.
>
> Dmitry
>
> On Tue, Oct 16, 2012 at 11:06 AM, Zeng Lames <lezhi.z...@gmail.com> wrote:
>
> > Hi,
> >
> > as we know, when we delete document from solr, it will add .del file to
> > related segment index files, then delete them from disk after optimize.
> > Now, the question is that before optimized, can we retrieve those deleted
> > records? if yes, how to?
> >
> > thanks a lot!
> >
> > Best Wishes
> > Lames
> >
>
>
>
> --
> Regards,
>
> Dmitry Kan
>

Reply via email to