cc299
创建自定义分词器
测试分词器
DELETE /test_analyzer
PUT /test_analyzer
{
  "settings": {
    "analysis": {
      "char_filter": {
        "sign_to_word": {
          "type": "mapping",
          "mappings": ["&=> and","+=>add"]
        }
      },
      "filter": {
        "my_stopwords": {
          "type": "stop",
          "stopwords": ["the", "a", "her", "his"]
        }
      },
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "char_filter": ["html_strip", "sign_to_word"],
          "tokenizer": "standard",
          "filter": ["lowercase", "my_stopwords"]
        }
      }
    }
  }
}
 
GET /test_analyzer/_analyze
{
  "text": "ruru is a her <a href/> HAHA!!!",
  "analyzer": "my_analyzer"
}

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-06-22
  • 2021-06-05
  • 2022-12-23
  • 2021-08-14
  • 2021-12-16
  • 2021-12-30
猜你喜欢
  • 2021-09-22
  • 2022-12-23
  • 2021-04-14
  • 2021-05-07
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案