I have the below data in the indexed documents
[
{
"HotelId": "1",
"HotelName": "Secret Point Motel",
"Description": "Ideally located on the main commercial artery of the city in the heart of New York.",
"Tags": [
"Free wifi",
"on-site **park**ing",
"indoor pool",
"continental breakfast"
],
"Address": {
"StreetAddress": "677 5th Ave",
"City": "New York",
"StateProvince": "NY"
}
},
{
"HotelId": "2",
"HotelName": "SBS Greenotel",
"Description": "Ideally located on the main commercial artery of the city in the heart of New York.",
"Tags": [
"Free wifi",
"Paid wifi",
"on-site **park**ing",
"podium **park**ing",
"indoor pool",
"continental breakfast"
],
"Address": {
"StreetAddress": "677 5th Ave",
"City": "New York",
"StateProvince": "NY"
}
}
]
And would like to search the hotels who's tags contains or matches the search phrase "park" (highlighted in above data)
I have tried search.ismatch function but the lambda expression doesn't supports it.
Any help on forming the odata query would be appreciated.
One possible solution to this is by including
analyzerin your index schema for partial matching of keywords.I have created an index with below schema:
And uploaded the below data:
With analyzer for tag field, I was able get results with search query: "park"
Note: Please modify the schema according to your requirement.
For more details please refer to this documentation.
And you can also check this thread with similar question.