jiangxinyu226

ElasticSearch 如何精确匹配?

  •  
  •   jiangxinyu226 · May 24, 2015 · 14810 views
    This topic created in 4184 days ago, the information mentioned may be changed or developed.

    比如有两个doc,name字段一个是abc,另一个是abc 2,不管用match_phrase还是match还是term搜索,都是abc 2排在前面。
    我只想要abc那个如何搜索?

    6 replies  •  2015-05-27 22:48:57 +08:00
    cevincheung
    cevincheung
    May 24, 2015
    1
    not_analyzer
    cevincheung
    cevincheung
    May 24, 2015
    2
    multi_field
    jiangxinyu226
    jiangxinyu226
    OP
    May 25, 2015
    4
    @czheo
    @cevincheung
    没懂啊。我想像数据库一样搜索 这么复杂啊
    RemRain
    RemRain
    May 25, 2015
    5
    设置 analyzer 为 not_analyzed,然后用 term 搜索。如果是 match 搜索的话,设置 type 为 phrase
    jiangxinyu226
    jiangxinyu226
    OP
    May 27, 2015
    6
    @RemRain 解决了 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2174 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 03:13 · PVG 11:13 · LAX 19:13 · JFK 22:13
    ♥ Do have faith in what you're doing.