Description
The Index App shows items as indexed based on a piece of metadata called CS5MarkAsIndexed. In a few circumstances, we've needed to reset these items to not show as indexed for specific workflows.
Below is an example of how we would remove a value from that field to reset this status.
NOTE: Modify your Metadata is only available in Capture Server Pro 1.10 and later.
Example
batch.Documents.ForEach(function (doc){
var RemoveIndexBool = doc.Metadata["General"]["CS5MarkAsIndexed"];
if (RemoveIndexBool === true){
builder.SetDocumentMetadata(doc.DocumentId, "General", "CS5MarkAsIndexed", false);
}
})
Below are the step by step instructions on what this script is doing.
1. |
var fieldToSet = "DocURL"; |
|
First, we want to define DocURL as a variable we label fieldToSet to be used later. |
2. |
batch.Documents.forEach(function (doc) |
|
Then, we will use a forEach to cycle through each document to perform our task on all documents. |
3. |
var docUrlValue = doc.Metadata["General"]["DocURL"]; |
|
From there, you will set a new variable called DocUrlValue to the general metadata value of DocURL as mentioned in the description above. NOTE: This will only be present after an Upload to Destination has been performed. |
4. |
builder.SetDocumentMetadata(doc.DocumentId, "Index", fieldToSet, docUrlValue); |
|
Finally, we will use SetDocoumentMetadata to set the fieldToSet (DocURL) with our docUrlValue from step 3 in the Index section. |
You should now be able to send a batch through a second index step.
Comments
0 comments
Please sign in to leave a comment.