how to set a query for like query in azure search

2019-07-28 03:27发布

I am trying azure search from my project and i am trying the following

 indexClient.Documents.Search<AuctionResult>("john", new SearchParameters { IncludeTotalResultCount = true, Filter = "SoldDate ge 2017-04-06 and SoldDate le 2017-04-06 and substringof(Title, '2007')" });

what i need is i need to filter the result based on the field Title, if Title contains the text '2007', it should be included.

what went wrong for me, what change should i make?

2条回答
叛逆
2楼-- · 2019-07-28 04:09

You can use a regex query to search within words. See the answer to this question for details.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-07-28 04:12

at last i found the solution

so we should use the following in the query

search.ismatch('searchQuery',Search_feild)"

so

"SoldDate ge 2017-04-06 and SoldDate le 2017-04-06 and search.ismatch('2007','Title')"
查看更多
登录 后发表回答