How to filter an empty array in Azure Search
Asked Answered
R

1

5

I have documents which look like below:

    {
        "@search.score": 1,
        "id": "cbdcc14a-4eab-7ce2-8c47-34cba81df722",
        "salesforceRecordID": "0015B00000Rtz4QQAR",
        "ownerType": "ABCS",
        "productDescription": "BCM WKSTN SW",
        "productName": "BCM Workstation",
        "lowerProductName": "bcm workstation",
        "productSKU": "CH-BCM100-X",
        "lowerProductSKU": "ch-bcm100-x",
        "productCode": "202046fc-7f80-P170-84df-6b3c9d6b2b18",
        "productRevision": "1",
        "productVersion": "3.0",
        "publishDate": "2018-04-15T09:47:03.245Z",
        "aomsOrderReleaseNbrArray": [
            "7639752001",
            "7639794003"
        ]
    },
    {
        "@search.score": 1,
        "id": "e468ba58-242c-7bfd-5870-fd34ba20da5b",
        "salesforceRecordID": "0015B00000Rs09aQAB",
        "ownerType": "SELF SUSTAINER",
        "productDescription": "BCM ENG TOOL",
        "productName": "BCM Engineering Tool",
        "lowerProductName": "bcm engineering tool",
        "productSKU": "CH-BCMET-X",
        "lowerProductSKU": "ch-bcmet-x",
        "productCode": "34f8448d-ddfb-P4d2-93c4-dc3ab5646fb7",
        "productRevision": "2",
        "productVersion": "3.0.2",
        "publishDate": "2018-04-15T08:40:23.781Z",
        "aomsOrderReleaseNbrArray": []
    }

The field aomsOrderReleaseNbrArray is filterable. I am looking for a syntax to filter aomsOrderReleaseNbrArray if it empty, something like

$filter=aomsOrderReleaseNbrArray ne []

Any suggestions?

Ratel answered 26/4, 2018 at 15:24 Comment(0)
R
9

Try this: $filter=aomsOrderReleaseNbrArray/any()

Rhododendron answered 26/4, 2018 at 17:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.