Search code examples
elasticsearchelasticsearch-7

How to view stored properties data in elasticsearch?


We have data in Elasticsearch which is mapped using _source and properties in the mapping configuration. Now we want to see what's in the properties fields but can't seem to find a way to make em shown in the {index}/doc/{docid} output. The data is stored because when we query on a field from a property it shows the correct result. Any idea what I am missing?


Solution

  • docvalue_fields solves it. When fields aren't marked as store: true in the mapping they aren't showing up when using fields,stored_fields options. The how's and why's are still unclear to me.

    {
        "query": {
            "match": {
                "productNumber": "HQ000003784"
            }
        },
        "docvalue_fields": [
            "productNumber"
        ],
        "size": 10,
        "from": 0,
        "sort": []
    }