Building search index through JavaScript no longer works: "Failed to open file"
I need to create a search index for some documents.
It seems like the JavaScript API does not support creating new search indices. For this reason, I have created an empty search index manually. I can use that to build the index like this:
// Global declaration
var oldDoc = null;
var buildIndexJob = null;
var buildIndex = app.trustedFunction( function(cDIPath, cExpr, bRebuildAll) {
app.beginPriv();
oldDoc = app.activeDocs[0];
buildIndexJob = catalog.getIndex(cDIPath).build("doc=oldDoc; " + cExpr, bRebuildAll);
app.endPriv();
});
// This is how I use the function
buildIndex('/C/Some/Path/My Index.pdx', 'app.alert("Done");', true);
For years, this has worked just fine. However, recently the code stopped working.
The log file reads like this:
Indexing 261 files
Extracting : C:\Users\....\SomeDocument.pdf
Fatal Search Engine Error : (-11) Failed to open file
Deleting files from current index
Error: Index build failedWhat is strange is that I can create the search index just fine through the Acrobat GUI.
Using Process Monitor, I don't see any problems like the PDF document not being accessible - so it's not clear to me which file Acrobat failed to open.
We use this code to generate search indices for different files. It could be related to the specific files, but it could also be due to an Acrobat update.
Any idea how I could debug this?
