MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Use order by on the `HighWaterMarkChangeDetectionPolicy` field with the search service API #107420

Closed julienFerreira closed 1 year ago

julienFerreira commented 1 year ago

Hello,

I'm currently work on solution of azure cognitive search with multiple cosmos db indexers.

I use .NET SDK to configure my indexes and indexers.

I set up the HighWaterMarkChangeDetectionPolicy on the _ts filed of my cosmos documents.

I set up the assumeOrderByHighWaterMarkColumn configuration to true like described in this section.

https://learn.microsoft.com/en-us/azure/search/search-howto-index-cosmosdb#incremental-indexing-and-custom-queries

But it remains an incomprehension on the finality. In this section give an example with a SQL like query but in my case I would like to use the search service API with a post request with the body:

{
    "count":true,
    "filter":"type eq 'collection'",
    "queryType":"full",
    "orderby":"_ts",
    "select":"id,collectionName,coverThumbnailURL,type,artists",
    "skip":0,
    "top":10
}

I specify the orderby property with _ts field, but this call gives me this error:

{
    "error": {
        "code": "",
        "message": "Invalid expression: Could not find a property named '_ts' on type 'search.document'.\r\nParameter name: $orderby"
    }
}

I didn't understand how to use order by on the HighWaterMarkChangeDetectionPolicy field with the search service API.

Thanks in advance for your help.

Regards.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ManoharLakkoju-MSFT commented 1 year ago

Duplicate of #107421