Finding Available Metadata
AllFieldValues
postconversion script to help you extract and review all the available metadata in
the documents of a repository.
To find available metadata
-
Make the
AllFieldValues
postconversion script available to CES:-
Save the content of the following script in the
[Index_Path]\Scripts\Postconversion-allfieldvalues.txt
text file on the Coveo Master server.'**************************************************************************** ' This postconversion script sample adds a new metadata named ' "AllFieldValues". This new metadata contains the name, the value and the ' type of all document metadata. '**************************************************************************** Option Explicit ' A double quote. Dim DOUBLE_QUOTE: DOUBLE_QUOTE = chr(34) ' This buffer variable holds all metadata names and values. Dim allValues: allValues = "<AllFieldValues>" & vbNewLine ' A collection of all field names. Dim fieldNames: fieldNames = DocumentInfo.Fields ' For each document field name. Dim fieldName For Each fieldName In fieldNames ' Get the field value. Dim fieldValue: fieldValue = DocumentInfo.GetFieldValue(CStr(fieldName)) ' Add the metadata name and its value to the buffer variable. allValues = allValues & "<Field" allValues = allValues & " name=" & DOUBLE_QUOTE & CStr(fieldName) & DOUBLE_QUOTE allValues = allValues & " value=" & DOUBLE_QUOTE & fieldValue & DOUBLE_QUOTE allValues = allValues & " type=" & DOUBLE_QUOTE & TypeName(fieldValue) & DOUBLE_QUOTE allValues = allValues & " />" & vbNewLine Next ' Add the new metadata. Call DocumentInfo.SetFieldValue("AllFieldValues", allValues & "</AllFieldValues>" & vbNewLine)
-
Add the postconversion script in the Administration Tool using the following values (see Adding a Postconversion Script):
-
Name:
AllFieldValues
-
Script File:
[Index_Path]\Scripts\Postconversion-allfieldvalues.txt
-
Script Language: VBScript
-
-
-
Associate the
AllFieldValues
postconversion script with the source for which you want to see all available metadata (see Applying a Source Conversion Script). -
Add the
AllFieldValues
custom field to the field set used by the source:-
If needed, create a new field set to be used by this source (see Adding a Field Set).
-
Add the
AllFieldValues
custom field to the appropriate field set using the following values (see Adding or Modifying Custom Fields).-
Name:
AllFieldValues
-
Type: String
-
Metadata Name:
AllFieldValues
-
-
Ensure that the source uses the field set that contains the
AllFieldValues
custom field (see Modifying the Field Set Used by a Source).
-
-
If not already done, rebuild the source to populate the
AllFieldValues
field for all documents of the source. -
Use the Index Browser to review the available metadata (see Reviewing Document Details from the Index Browser).
What's Next?
Create custom fields with the useful metadata listed in the AllFieldValues field. Use the Field name value as your metadata name (see Adding or Modifying Custom Fields).