Search code examples
azureazure-cognitive-search

Partial Match Azure Search


Azure Cognitive Search

{
      "name": "projectId",
      "type": "Edm.String",
      "facetable": false,
      "filterable": true,
      "key": false,
      "retrievable": true,
      "searchable": true,
      "sortable": true,
      "analyzer": "standard.lucene",
      "indexAnalyzer": null,
      "searchAnalyzer": null,
      "synonymMaps": [],
      "fields": []
    }

I have an Index with a string field , that holds an id e.g. ABC1234

when I query like this I get no results?

search=/.*1234./&$queryType=full&$count=true&$searchMode=any

Any ideas?


Solution

  • enter image description here

    The error is in your regex. The last '.' matches any character (except for line terminators).

    Just add a '*' at the end, it will match tokens:

    enter image description here