Watson Discovery

 View Only
Expand all | Collapse all

How to map the metadata fields to indexfields ?

  • 1.  How to map the metadata fields to indexfields ?

    Posted Sat June 19, 2021 06:57 AM
    Hi,

    I am uploading text documents and supply metadata (as JSON) with each document.
    My expectation is that this metadata (similar to  uploading JSON files) results in fields in the index .

    Is that assumption correct ? 
    Or should I revert back to JSON for the entire document ?
    To be clear, right now I have .txt files + JSON for the metadata (like author, date, keywords....)

    In Java (excerpt): 
    AddDocumentOptions options = new AddDocumentOptions.Builder()
    .projectId(<projecitd>)
    .collectionId(<collectionoid)
    .file(txtFile)
    .filename(txtFile.getName())
    .metadata(jsonMetaData)
    .fileContentType(HttpMediaType.TEXT_PLAIN)
    .build();

    Thanks again


    ------------------------------
    Michel Jonker
    ------------------------------

    #WatsonDiscovery


  • 2.  RE: How to map the metadata fields to indexfields ?

    Posted Mon June 21, 2021 03:51 AM
    Edited by System Fri January 20, 2023 04:42 PM
    Ok, I have misunderstood the mapping.
    The metadata is not available as a field in the manage fields page.
    But they can used in facets: they get the prefix : metadata
    And you can also enrich the metadata fields

    ------------------------------
    Michel Jonker
    ------------------------------