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

Getting a complex type from the ComplexTypeCollection by the condition #107374

Closed decadance-dance closed 1 year ago

decadance-dance commented 1 year ago

I have a collection of complex types. I want to get a specific complex type from this collection by condition. The use case:

"transcription": [
          {
              "text": "Hello world!!!",
              "start": "0:00:03.52",
              "end": "0:00:11.24"
          },
          {
              "text": "Bye world!!!",
              "start": "0:00:11.44",
              "end": "0:00:11.64"
          }
]

I want to get the complex object { "text": "Hello world!!!", "start": "0:00:03.52", "end": "0:00:11.24" } based on the condition that it contains the word "hello" in the "text" field

Is it possible?

Document Details

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

Naveenommi-MSFT commented 1 year ago

@decadance-dance Thanks for your feedback! We will investigate and update as appropriate.

RyanHill-MSFT commented 1 year ago

Hi @decadance-dance, the filter expressions you want look into would be search.ismatch and search.ismatchscoring as the OData filter expressions that combine the full text search with strict Boolean filtering. For more information on these filters, see OData full-text search functions in Azure Cognitive Search - search.ismatch and search.ismatchscoring.

You can also look into using the search.in function which allows you to search within an array of values; see OData search.in function in Azure Cognitive Search for information.