Logic flaw in index code prevents index from completing

Logic flaw in index code prevents index from completing
Indexing Knowedge Managment fails. In the Knowledge Errors table the following messages are seen: "Error indexing document, bad attachment'. In many cases customers state that Index Attachments is set to false.

Solution to this problem is provided in KM00245513: The following steps will resolve this issue.
1. Go to Database Manager
2. Access ScriptLibrary
3. Find and open script library "KMDocument_Index"
4. Locate this line (should be line #226): indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,ALText);
5. Modify the line to read: indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,ALText, indexDoc);
6. Save
7. Perform a Full Index on Knowledge_Library
8. Index should complete and errors should no longer be present.

Problem is i can't locate line: indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,ALText);

in UAT or PROD (attached).

The closest to this line i can get is: indexDoc = system.library.KMDocument_Index.setDocumentFieldValue( "adlearn_" vlang, ALText, indexDoc );

UAT.zip
  • Verified Answer

    Hello Xholi,

    hope you are doing fine.

    According to your description I check from 9.31 to 9.41 OOB and in all of them I have the same script line:

    indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,docbodyfile, indexDoc);

    I believe that maybe the KM is not correct about and was a little mistake. Here are to possible suggestion, modify the above line or modify the line below:

    indexDoc = system.library.KMDocument_Index.setDocumentFieldVa​lue( "adlearn_" vlang, ALText, indexDoc );

    The result would be:

    indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,docbodyfile, indexDoc);

    by

    indexDoc = system.library.KMDocument_Index.setDocumentFieldValue("docbody_" vlang,ALText, indexDoc);

    OR

    indexDoc = system.library.KMDocument_Index.setDocumentFieldVa​lue( "adlearn_" vlang, ALText, indexDoc );

    by

    indexDoc = system.library.KMDocument_Index.setDocumentFieldVa​lue( "docbody_" vlang, ALText, indexDoc );

    Test one change, if doesn't work test the another change. In case to not have positive results, we should report thst the we need to fix the KM.