How Can i use Azure Search Like Syntax

柔情痞子 提交于 2019-12-11 22:06:05

问题


In my Azure Search , i have two document , one column is call "Description"

And two record like this

[ 
{"Description": "XARATM | KONE"},
{"Description": "ATM | RCOR"}
]

my problem is , when i use Azure Search to search my record like:

https://myservice.search.windows.net/indexes/searchproduct/docs?search=ATM&api-version=2014-07-31-Preview

they just return one record {"Description": "ATM | RCOR"} , but i need two record. so can i use some syntax like T-SQL

SELECT * FROM SearchProduct WHERE Description Like '%ATM%'

Thank you


回答1:


Azure Search does support wildcards, but only in the format ATM*, that would allow to search for words in the form of suffixes such as ATMa or ATMb. In your case, you would need *ATM, which is not currently supported with Azure Search.

To learn more about wildcards for suffix, please visit the MSDN API documentation on this topic here.

Liam




回答2:


Although you can't use prefix wildcards in Azure search, you can use regular expressions which may be able to handle allowing some variance in your search criteria.

https://littlekendra.com/2016/10/25/wildcard-vs-regular-expressions-lucene-query-in-azure-search/

Examples:

business_title:/(Sen|Jun)ior/

business_title:/(.)rchit(.)/



来源:https://stackoverflow.com/questions/28001981/how-can-i-use-azure-search-like-syntax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!