Skip to main content

Filter by ids Failing with Content API Search with ES Query

If you want to exclude _ids from returning in a query and your syntax appears to be right:

https://api.{{org}}.arcpublishing.com/content/v4/search/published?website={{website}}&body={
    "filtered ": {
        "filter": {
            "bool": {
                "must": [
                    {
                        "term": {
                            "taxonomy.sections._id": "/sports/cowboys"
                        }
                    }
                ],
                "must_not": {
                    "ids": {
                        "values": [
                            "NMARCK32YNQPGGXCW34KGRUB7A"
                        ]
                    }
                }
            }
        }
    }
}&size=11&from=0&_sourceInclude=websites.{{website}}.website_url,headlines.basic,promo_items.basic.additional_properties.proxyUrl,first_publish_date,display_date,last_updated_date,taxonomy.tags.text&sort=display_date:desc

See example below: 

{
    "query": {
        "bool": {
            "must": [{
                "nested": {
                    "path": "taxonomy.sections",
                    "query": {
                        "bool": {
                            "must": [{
                                "term": {
                                    "taxonomy.sections._id": "/sports/cowboys"
                                }
                            }]
                        }
                    }
                }
            }],
            "must_not": {
                "ids": {
                    "values": ["default_true_NMARCK32YNQPGGXCW34KGRUB7A"]
                }
            }
        }
    }
}