5

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

King Jk
  • 1,069
  • 14
  • 22

2 Answers2

6

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

  • 1
    Thank you , i really want report this issue for M$ ... , it's look like anyone will need it – King Jk Jan 18 '15 at 05:58
  • A good place for you and others to let us know about this is our UserVoice page. Here is a direct link to this particular feature request where you can also add specific comments if you like: http://feedback.azure.com/forums/263029-azure-search?query=wildcard – Liam Cavanagh - MSFT Jan 19 '15 at 18:51
  • Also, I would like to add that even though Lucene (and layers built on top of it), support wildcards like this as a query operator, these are brute-forced against the inverted index unless you have a custom indexing/querying scheme. As a result, if indexes grow to any non-trivial size performance will suffer significantly. As a result, even though we do understand the value of this feature, we want to make sure that if this is implemented, that we take these performance factors into account. – Liam Cavanagh - MSFT Jan 19 '15 at 18:51
  • 1
    In fact . i abandon Azure Search . And hug ElasticSearch . i'm ask this question in MSDN . if you want choose Azure Search . maybe you need look before use . https://social.msdn.microsoft.com/Forums/en-US/e02ac3b3-72cc-4433-833d-29c834463244/azure-search-preview-can-i-use-prefix-operator-?forum=azuresearch – King Jk Jan 29 '15 at 14:09
0

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(.)/

ToDevAndBeyond
  • 1,120
  • 16
  • 24