• Hiway
    2019-08-17
    confidence和prefix_length具体是如何控制结果返回的?老师这些可以顺便讲一两句吧,就说一句可以通过修改配置控制返回结果,这不是废话吗?配置参数就是用来修改结果的啊
     3
     5
  • 死者苏生
    2019-10-13
    popular和always在测试后没有区别啊,我在7.4版本上测试always,效果和popular是一模一样的,就算用算分最高的text进行匹配,option里也依然是空的。
     1
    
  • zmnum1
    2019-10-02
    老师能给一个中文补全的例子吗?感谢!
    
    
  • godtrue
    2019-09-21
    搜索推荐——有几种方式,大概原理是搜索的没有时,给出最小修改可搜索到的。
    
    
  • 三木禾
    2019-08-31
    老师您好,在本节中,有几个术语不是很明白,比如,sort:"frequency",文档上说是文档频率,还有相似度评分,还有term自身,这几个排序相似度评分可以理解,但是term自身和文档频率不是很理解,希望老师看到能解答一下
    
    
  • Geek_Dream
    2019-08-23
    老师,有报错信息如下:
    {
      "error": {
        "root_cause": [
          {
            "type": "parsing_exception",
            "reason": "Unknown key for a START_OBJECT in [multi_match].",
            "line": 2,
            "col": 20
          }
        ],
        "type": "parsing_exception",
        "reason": "Unknown key for a START_OBJECT in [multi_match].",
        "line": 2,
        "col": 20
      },
      "status": 400
    }
    为什么ES在执行单字符多字段时,会产生multi_match原因呀
    展开
    
    
  • jaynnay
    2019-08-19
    老师,confidence看了文档也没看懂,感觉应该是推荐结果可信度的意思,文档我理解的大概意思是:为结果设置一个阈值,而这个阈值是由输入短语(text的值?)的分数和confidence计算而来,我改变这个值比如从1-100,结果确实变了,但又不知道怎么计算的,请老师解答下
    
    
  • xsg
    2019-08-06
    老师,为什么下面的不可以搜索出结果?
    GET /articles/_search
    {
      "suggest": {
        "term-suggestion": {
          "text": "rocks",
          "term": {
            "suggest_mode": "always",
            "field": "body"
          }
        }
      }
    }
    而下面的又可以搜索出结果?
    GET /articles/_search
    {
      "suggest": {
        "term-suggestion": {
          "text": "rock",
          "term": {
            "suggest_mode": "always",
            "field": "body"
          }
        }
      }
    }
    还有,confidence和prefix_length具体是如何控制结果返回的?
    展开
    
    
  • Icebreaker
    2019-08-05
    官网看到这两段话 可能就是这个原因 穷用的是match_phrase_prefix

    Note that the postings highlighter is meant to perform simple query terms highlighting, regardless of their positions. That means that when used for instance in combination with a phrase query, it will highlight all the terms that the query is composed of, regardless of whether they are actually part of a query match, effectively ignoring their positions.


    The postings highlighter doesn’t support highlighting some complex queries, like a match query with type set to match_phrase_prefix. No highlighted snippets will be returned in that case.
    展开

    作者回复: 你是说东方网吧的问题吗?

    我看你用的是match query啊,你去看了有同义词么?

     1
    
  • Icebreaker
    2019-08-04
    感谢老师答复!环境是我自己的!ik我们老大装的!到时候我换官网下载的看看!

    作者回复: 你可以登录机器,查看一下ik插件的目录中是否安装配置了同义词词库。你这个现象感觉是配置了同义词词库导致的

    
    
  • Icebreaker
    2019-08-03
    以上是我的索引 及mapping 提供一些数据给老师您看看
    我搜索‘’中国北‘’ 高亮部分会把 “京市”两个字做了高亮处理
    如果mapping 不设置分词器的话返回高亮部分是对的

    "highlight" : {
              "address" : [
                "</em>中国<em></em>北京市<em>朝阳区建国门"
              ]
            },
    展开
    
    
  • Icebreaker
    2019-08-03
    POST _bulk
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"双榆树-张三","massage":"今天天气不错啊,出去转转去","uid":2,"age":20,"city":"北京","province":"北京","country":"中国","address":"中国北京市海淀区","location":{"lat":39.970718,"lon":116.325747}}
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"老城区-老刘","massage":"出发,下一站云南","uid":3,"age":30,"city":"北京","province":"北京","country":"中国","address":"中国北京市老城区台基厂33号","location":{"lat":39.904313,"lon":116.412754}}
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"东城区-李四","massage":"happy birthday!","uid":4,"age":30,"city":"北京","province":"北京","country":"中国","address":"中国北京市东城区","location":{"lat":39.893801,"lon":116.408986}}
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"朝阳区-老贾","massage":"你有没有在在想我","uid":5,"age":35,"city":"北京","province":"北京","country":"中国","address":"中国北京市朝阳区建国门","location":{"lat":39.718256,"lon":116.367910}}
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"朝阳区-老王","massage":"祝你生日快乐 Miss you","uid":6,"age":50,"city":"北京","province":"北京","country":"中国","address":"中国北京市朝阳区国贸","location":{"lat":39.918256,"lon":116.467910}}
    {"index":{"_index":"twitter", "_type" : "_doc"}}
    {"user":"虹桥-老吴","massage":"什么狗屁生日 我就没有过过","uid":7,"age":99,"city":"上海","province":"上海","country":"中国","address":"中国上海市闵行区","location":{"lat":31.175927,"lon":121.383328}}

    GET twitter/_search
    { "query": {"multi_match": {"type": "phrase_prefix", "query": "中国北","analyzer": "ik_smart"}},"highlight": {"post_tags": ["<em>"],"pre_tags": ["</em>"],"fields": {"address": {}}
      },"sort": [{"age": {"order": "desc"}}]}
    展开

    作者回复: 你的ik分词器哪里下载的?有自己做定制化么?

    
    
  • Icebreaker
    2019-08-03
    PUT twitter
    {"settings": {"number_of_shards": 1} }

    PUT twitter/_mapping/_doc
    { "properties" : { "address" : {"type" : "text","analyzer":"ik_smart","fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256 } } },"age" : {"type" : "long"},"city" : {"type" : "text","fields" : { "keyword" : {"type" : "keyword","ignore_above" : 256} }},"country" : {"type" : "text","fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256} }},"location" : { "type":"geo_point" },"massage" : {"type" : "text","fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}},"province" : {"type" : "text","fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}},"uid" : {"type" : "long"},"user" : {
    "type" : "text","fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256} }}}}

    展开
    
    
  • 💀WILL-beta💀
    2019-08-02
    请问大师,若是用户给的词已经是一个正确的term,如何在此基础之上再给出suggestion?
    比如库里同时有iPhone与iPhonePlus,用户输入了iPhone,是否能够给出iPhonePlus的suggestion?
    
    
  • 刘丹
    2019-07-29
    请问中文可以使用suggester吗?

    作者回复: 当然可以

    
    
我们在线,来聊聊吧