zoukankan      html  css  js  c++  java
  • elasticsearch 上下文

    比如我搜star,是指star wars,还是指starbucks

    #上下文 contexts PUT comments { "mappings": { "properties": { "comment_autocomplete":{ "type": "completion", "contexts":
    [{ "type":"category", "name":"comment_category" }] } } } } POST comments/_doc { "comment":"I love the star war movies", "comment_autocomplete":{ "input":["star wars"], "contexts":{ "comment_category":"movies" } } } POST comments/_doc/1 { "comment":"Where can I find a Starbucks", "comment_autocomplete":{ "input":["starbucks"], "contexts":{ "comment_category":"coffee" } } } POST comments/_search { "suggest": { "MY_SUGGESTION": { "prefix": "sta", "completion":{ "field":"comment_autocomplete", "contexts":{ "comment_category":"coffee" } } } } }
    无为而治
  • 相关阅读:
    冲刺一(5)
    冲刺一(4)
    冲刺一(3)
    构建之法阅读笔记之二
    冲刺一(2)
    冲刺一(1)
    第9周总结
    热词顶会分析
    第8周总结
    构建之法阅读笔记之一
  • 原文地址:https://www.cnblogs.com/wangchuanfu/p/14146075.html
Copyright © 2011-2022 走看看