cancel
Showing results for 
Search instead for 
Did you mean: 

How to reindex specific documents in Lucene

d5m
Champ in-the-making
Champ in-the-making
Is there any way to reindex in Lucene just one (or a set of) document(s)? I've only seen the way to reindex the full repository, but not individual documents.

Regards
1 REPLY 1

nvir
Champ in-the-making
Champ in-the-making
Hello,

With a Javascript, you may search for the docs and then apply the save function. The documents are then marked dirty and will be reindexed:

   var docs = search.luceneSearch("TEXT:test");   for (var i=0; i<docs.length; i++) {      if (docs[i] != null) {         docs[i].save();      }   }‍‍‍‍‍‍‍‍

See example of Javascript there: http://wiki.alfresco.com/wiki/JavaScript_API_Cookbook

Greetings