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