The data store is normal, and the fuzzy search is empty?

I have a piece of data that says:

善恩康生物科技(苏州)有限公司

Field is:

{"name": {"type": "text","analyzer": "ik_max_word", "search_analyzer": "ik_smart" }}

My search statement is:

{"query":{"match_phrase":{"name":{"query":"善恩康"}}}}

return:

{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 4,
    "successful": 4,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
  "total": {
    "value": 0,
    "relation": "eq"
  },
  "max_score": null,
  "hits": [ ]
  }
}

I tried using ID queries:

{"query":{"match":{"_id":{"query":"10419864"}}}}

return:

{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 4,
    "successful": 4,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
  "total": {
  "  value": 1,
    "relation": "eq"
  },
  "max_score": 1,
  "hits": [
      {
        "_index": "enterprise",
        "_type": "_doc",
        "_id": "10419864",
        "_score": 1,
        "_source": {
        "alias_names": "善恩康",
        "name": "善恩康生物科技(苏州)有限公司",
        "status": 1,
      }
    }
    ]
  }
}

Please do not post images of text as it is hard to read for many and impossible to copy and paste from if anyone tries to recreate the issue. Instead copy the text and add it to the thread properly formatted using the available tools.

What is the mapping of the field you are searching? How does the value in the document you indexed and expect to find tokenize? How does that compare to the tokenization of the query text?

Thanks for your reply!
I've made changes and reposted it

OK. You have a different analyzer at search and index time. Please run the respective strings with their respective analyzer through the analyze API and post the results. I do not know Chinese, but this should show why you are not getting a match.

I tried to specify the official participle "Standard" in the search. But I also got empty results:

{"query":{"match_phrase":{"name":{"query":"善恩康","analyzer":"standard"}}}}

To resolve this you need to use the analyze API. Have a look at the examples here as well.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.