jiangxinyu226

ElasticSearch 如何精确匹配?

  •  
  •   jiangxinyu226 · May 24, 2015 · 12720 views
    This topic created in 4061 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
        1
    cevincheung  
       May 24, 2015
    not_analyzer
    cevincheung
        2
    cevincheung  
       May 24, 2015
    multi_field
    jiangxinyu226
        4
    jiangxinyu226  
    OP
       May 25, 2015
    @czheo
    @cevincheung
    没懂啊。我想像数据库一样搜索 这么复杂啊
    RemRain
        5
    RemRain  
       May 25, 2015
    设置 analyzer 为 not_analyzed,然后用 term 搜索。如果是 match 搜索的话,设置 type 为 phrase
    jiangxinyu226
        6
    jiangxinyu226  
    OP
       May 27, 2015
    @RemRain 解决了 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5444 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 09:11 · PVG 17:11 · LAX 02:11 · JFK 05:11
    ♥ Do have faith in what you're doing.