Reputation: 10930
I'm having a complex document in my Cosmos DB like below
{
"id": "e064a694-8e1e-4660-a3ef-6b894e9414f7",
"Name": "Lidiya Lawrence",
"languageBatchResult": {
"id": "Lidiya Lawrence",
"Languages": [
{
"name": "English"
}
]
},
"keyPhraseBatchResult": {
"Keys": [
"Government of India",
"Training Co-ordinator",
"customer support",
"months"
]
}
}
I'm trying to implement Azure Search with this data.
The problem is how should I able to create an index as searchable for the keyPhraseBatchResult
/Keys
which is having the list of values?
I already tried to create an index with keyPhraseBatchResult
in azure search but it's not working. The indexing is working only for Name
unfortunately
Update 1
After adding the keyphrases
how to map the field now?
Upvotes: 0
Views: 250
Reputation: 10930
Modeling/Mapping Complex Types in Indexes Feature is finally implemented by microsoft
As per that, we have 2 new data types called Edm.ComplexType
and Collection(Edm.ComplexType)
with this we can easily map our indexes
[Note: It is start supported by api-version=2019-05-06]
Upvotes: 0
Reputation: 787
To index /keyPhraseBatchResult/Keys
, you need to first create a Collection(Edm.String) index field keyphrases
to store your list.
Then you need to set up your indexer with a field mapping from /keyPhraseBatchResult/Keys
to keyphrases
.
Upvotes: 1