2

I have a table with a lot of data. One field is a string for example

searchableField

  • row 1: abcdefgdefg1hijklmnopqrstuvw234234

  • row 2: abcdefgdefg1hijklmnopqrstuvw2dsfds33

  • row 3: abcdefgdefg1hijklmnopqrstuvw234234
  • row 4: abcdefgdefg1hijklmnopqrstuvwweewere333wr
  • row 5: abcdefgdefg2hijklmnopqrstuvw234222aadfff
  • row 6: abcdefgdefg1hijklmnopqrstuvwdsfdsf

I only want result row 5 back, but adding search therm defg2 won't work. In some other cases I want onl y result 1, 2, 3, 4, 6 back. but also searching on defg1 won't work for me.

Something that should work for me is a filter, but unfortunately there are no filters with contains. What can I do as work around?

1408786user
  • 1,868
  • 1
  • 21
  • 39

3 Answers3

3

Please read the How full text search works in Azure Search article. It will help you understand how your documents and query terms are processed and how to customize the behavior of your search index to achieve the results you want.

In your case, you might want to create a custom analyzer that will break up the long terms in your document into smaller ones that are likely to be used as query terms by users of your application.

Alternatively, you can issue a wildcard or a regex query using the Lucene query language to simulate the contains behavior you're looking for. More information here: Azure search, search by partial terms

Community
  • 1
  • 1
Yahnoosh
  • 1,932
  • 1
  • 11
  • 13
0

Below lucene query will help for doing a like or contains search as above question

 item : /.* defg2 .*/
Bibek Panda
  • 519
  • 4
  • 10
0

you can use search.ismatch or search.ismatchscoring functions

ex: "filter": "search.in(metadata_library, 'a3e9838f-3fec-49d8-a1ea-46f361238ffd') and search.ismatch('[exe pixel!][test new tags 102][css monitor]', 'metadata_tags','simple','all')",

Janakiram
  • 1
  • 1