Elasticsearch 相关度评分TF&IDF算法揭秘

2023-11-18

1.算法介绍

    relevance score算法,简单来说,就是计算出,一个索引中的文本,与搜索的文本,他们之间的关联匹配程序

    ElasticSearch使用的是term frequency/inverse document frequency算法,简称TF/IDF算法

    Term frequency,搜索文本中的各个词条在field文本中出现了多少次,出现次数越多,就越相关

    Inverse document frequency:搜索文本中的各个词条在整个索引的所有文档中出现多少次,出现的次数越多,就越不相关

    Field-length norm:field长度,field越长,相关度越弱

 

1.1 TF例子:搜索请求hello world

    doc1:hello you,and world is very good

    doc2:hello you,how are you

    显然,搜索的请求在doc1中出现了两次,在doc2中出现了一次,doc1更相关

 

1.2 IDF例子:搜索请求hello world

    doc1:hello,today is very good -- hello

    doc2:hi world,how are you  -- world

    比如说,在index中有一万条document,hello这个单词在所有的document中,一共出现了1000次,word这个单词在所有的document中一共出现了100次,那么显然doc2更相关,因为world在所有document中出现的次数更少,越不相关

 

1.3 Field-length norm:field长度,field越长,相关度越弱

    搜索请求:hello world

    doc1:{"title":"hello article","contennt":"balabala  一万个单词"}

    doc2: {"title":"my article","content":"balabala 一万个单词 ,hi world"}

    hello world在整个index中出现的次数是一样多的

    doc1的field:(hello出现在title中,world出现在content中),field更短,所以相关度更强

 

2._score是如何被计算出来的?

    • 执行一次请求

GET /test_index/test_type/_search
{
  "query":{
    "match":{
      "test_field": "test world"
    }
  }
}

    •  执行结果:

{
  "took": 36,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 5,
    "max_score": 1.4867525,
    "hits": [
      {
        "_index": "test_index",
        "_type": "test_type",
        "_id": "6",
        "_score": 1.4867525,
        "_source": {
          "test_field": "test world test"
        }
      },
      {
        "_index": "test_index",
        "_type": "test_type",
        "_id": "3",
        "_score": 1.0754046,
        "_source": {
          "test_field": "test world"
        }
      },
      {
        "_index": "test_index",
        "_type": "test_type",
        "_id": "5",
        "_score": 0.9471576,
        "_source": {
          "test_field": "test 001"
        }
      },
      {
        "_index": "test_index",
        "_type": "test_type",
        "_id": "1",
        "_score": 0.7126236,
        "_source": {
          "test_field": "test hello001"
        }
      },
      {
        "_index": "test_index",
        "_type": "test_type",
        "_id": "2",
        "_score": 0.45203948,
        "_source": {
          "test_field": "world xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        }
      }
    ]
  }
}

    •  我们可以查看一下如何计算出的_score

GET /test_index/test_type/_search?explain
{
  "query":{
    "match":{
      "test_field": "test world"
    }
  }
}

    •  执行结果,可以看到每个document的_score怎么计算出来的

{
  "took": 294,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 5,
    "max_score": 1.4867525,
    "hits": [
      {
        "_shard": "[test_index][2]",
        "_node": "5JcZFTo8TMGAcBR5psWKmg",
        "_index": "test_index",
        "_type": "test_type",
        "_id": "6",
        "_score": 1.4867525,
        "_source": {
          "test_field": "test world test"
        },
        "_explanation": {
          "value": 1.4867526,
          "description": "sum of:",
          "details": [
            {
              "value": 1.4867526,
              "description": "sum of:",
              "details": [
                {
                  "value": 1.1230313,
                  "description": "weight(test_field:test in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 1.1230313,
                      "description": "score(doc=0,freq=2.0 = termFreq=2.0\n), product of:",
                      "details": [
                        {
                          "value": 0.98082924,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 3,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 1.1449814,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 2,
                              "description": "termFreq=2.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 2.3333333,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 4,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "value": 0.36372137,
                  "description": "weight(test_field:world in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.36372137,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.47000363,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 2,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 3,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7738693,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 2.3333333,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 4,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "*:*, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_index][4]",
        "_node": "5JcZFTo8TMGAcBR5psWKmg",
        "_index": "test_index",
        "_type": "test_type",
        "_id": "3",
        "_score": 1.0754046,
        "_source": {
          "test_field": "test world"
        },
        "_explanation": {
          "value": 1.0754046,
          "description": "sum of:",
          "details": [
            {
              "value": 1.0754046,
              "description": "sum of:",
              "details": [
                {
                  "value": 0.5377023,
                  "description": "weight(test_field:test in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.5377023,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.6931472,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 2,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7757405,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.5,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "value": 0.5377023,
                  "description": "weight(test_field:world in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.5377023,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.6931472,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 2,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7757405,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.5,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "*:*, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_index][1]",
        "_node": "5JcZFTo8TMGAcBR5psWKmg",
        "_index": "test_index",
        "_type": "test_type",
        "_id": "5",
        "_score": 0.9471576,
        "_source": {
          "test_field": "test 001"
        },
        "_explanation": {
          "value": 0.9471576,
          "description": "sum of:",
          "details": [
            {
              "value": 0.9471576,
              "description": "sum of:",
              "details": [
                {
                  "value": 0.9471576,
                  "description": "weight(test_field:test in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.9471576,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 1.3862944,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 5,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.6832298,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "*:*, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_index][3]",
        "_node": "5JcZFTo8TMGAcBR5psWKmg",
        "_index": "test_index",
        "_type": "test_type",
        "_id": "1",
        "_score": 0.7126236,
        "_source": {
          "test_field": "test hello001"
        },
        "_explanation": {
          "value": 0.71262366,
          "description": "sum of:",
          "details": [
            {
              "value": 0.71262366,
              "description": "sum of:",
              "details": [
                {
                  "value": 0.71262366,
                  "description": "weight(test_field:test in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.71262366,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.98082924,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 3,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7265522,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.3333334,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "_type:test_type, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      },
      {
        "_shard": "[test_index][2]",
        "_node": "5JcZFTo8TMGAcBR5psWKmg",
        "_index": "test_index",
        "_type": "test_type",
        "_id": "2",
        "_score": 0.45203948,
        "_source": {
          "test_field": "world xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        },
        "_explanation": {
          "value": 0.45203945,
          "description": "sum of:",
          "details": [
            {
              "value": 0.45203945,
              "description": "sum of:",
              "details": [
                {
                  "value": 0.45203945,
                  "description": "weight(test_field:world in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.45203945,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.47000363,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 2,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 3,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.96177864,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 2.3333333,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "*:*, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}


说明:拿第一个document分析

"_explanation": {
          "value": 1.0754046,
          "description": "sum of:",
          "details": [
            {
              "value": 1.0754046,
              "description": "sum of:",
              "details": [
                {
                  "value": 0.5377023,
                  "description": "weight(test_field:test in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.5377023,
                      注释:termFreq:term出现的频率为1
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.6931472,
                          注释:idf 计算公式
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 2,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7757405,
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.5,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                },
                {
                  "value": 0.5377023,
                  "description": "weight(test_field:world in 0) [PerFieldSimilarity], result of:",
                  "details": [
                    {
                      "value": 0.5377023,
                      "description": "score(doc=0,freq=1.0 = termFreq=1.0\n), product of:",
                      "details": [
                        {
                          "value": 0.6931472,
                          "description": "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "docFreq",
                              "details": []
                            },
                            {
                              "value": 2,
                              "description": "docCount",
                              "details": []
                            }
                          ]
                        },
                        {
                          "value": 0.7757405,
                          注释:tfNorm
                          "description": "tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:",
                          "details": [
                            {
                              "value": 1,
                              "description": "termFreq=1.0",
                              "details": []
                            },
                            {
                              "value": 1.2,
                              "description": "parameter k1",
                              "details": []
                            },
                            {
                              "value": 0.75,
                              "description": "parameter b",
                              "details": []
                            },
                            {
                              "value": 1.5,
                              "description": "avgFieldLength",
                              "details": []
                            },
                            {
                              "value": 2.56,
                              "description": "fieldLength",
                              "details": []
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "value": 0,
              "description": "match on required clause, product of:",
              "details": [
                {
                  "value": 0,
                  "description": "# clause",
                  "details": []
                },
                {
                  "value": 1,
                  "description": "*:*, product of:",
                  "details": [
                    {
                      "value": 1,
                      "description": "boost",
                      "details": []
                    },
                    {
                      "value": 1,
                      "description": "queryNorm",
                      "details": []
                    }
                  ]
                }
              ]
            }
          ]
        }

    •  也可以查询一条数据,执行explain

GET /test_index/test_type/1/_explain
{
  "query":{
    "match":{
      "test_field": "test world"
    }
  }
}

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Elasticsearch 相关度评分TF&IDF算法揭秘 的相关文章

  • 如何在elasticsearch中使用冒号搜索模式?

    我在 Elasticsearch 中有一个字段 其值为 ft 05 08 2015 13 01 27 358 cgn 4189 当我想使用查询字符串 cgn 4189 进行搜索时 我没有结果 我尝试像 cgn 4189 一样转义冒号 但有语
  • Elasticsearch 对字符串排序未返回预期结果

    当对包含多个单词的字符串字段进行排序时 Elasticsearch 会拆分字符串值并使用最小值或最大值作为排序值 即 当对值为 老虎之眼 的字段进行升序排序时 排序值为 Eye 当按降序排序时 排序值为 Tiger 假设我的索引中有 老虎之
  • 在ElasticSearch中搜索没有时间的日期字段值

    我的数据中有一个日期字段为 type date format dateOptionalTime 现在我的日期字段和值是 INITIAL EXTRACT DATE 2015 04 02T06 47 57 78 05 30 在搜索时 我仅根据
  • 在elasticsearch中过滤facet

    我有一个如下查询 query query query string query s q filter ids values list ids facets destination terms field destination en hot
  • match_none 有什么用?

    我浏览了docs https www elastic co guide en elasticsearch reference current query dsl match all query html query dsl match no
  • Logstash删除类型并保留_type

    我有一个logstash 客户端和服务器 客户端将带有logstash的udp输出的日志文件发送到服务器 服务器也运行logstash来获取这些日志 在服务器上 我有一个 json 过滤器 它会在实际日志的字段中提取 json 格式的消息
  • 如何使用elasticsearch进行分页?来自 vs 滚动 API

    我使用elasticsearch作为数据库来存储大量日志数据 我知道有两种方法可以进行分页 使用大小并来自 API 使用滚动API 现在我使用 from 进行分页 从前端和后端获取页面和大小参数 Java searchSourceBuild
  • 弹性搜索模糊匹配,精确匹配首先显示

    我想在查询中使用模糊匹配 但精确匹配显示在结果的顶部 我已经尝试过以下方法 return this gt client gt search array index gt self INDEX type gt self TYPE body g
  • 随着索引和文档数量恒定,elasticsearch 批量索引会随着时间的推移而变慢

    我遇到了使用 NET NEST 客户端和 ElasticSearch 进行批量索引的性能随着时间的推移 索引数量和文档数量恒定而降低的情况 我们正在奔跑ElasticSearch Version 0 19 11 JVM 23 5 b02在具
  • 局部敏感哈希 - Elasticsearch

    有没有允许在 Elasticsearch 上使用 LSH 的插件 如果是的话 您能否指出该位置并告诉我如何使用它 谢谢 编辑 我发现ES使用了MinHash插件 我怎样才能用这个来比较文件呢 查找重复项的最佳设置是什么 有一个Elastic
  • 全文搜索 DynamoDB

    以下情况 我正在为我的客户将元素存储在 DyanmoDb 中 HashKey 是元素 ID Range Key 是客户 ID 除了这些字段之外 我还存储一个字符串数组 gt 标签 例如 Pets House 和多行文本 我想在我的应用程序中
  • 在 Elastic 搜索中加载示例数据集时出错

    您好 我正在尝试加载示例数据集参考弹性搜索文档 https www elastic co guide en elasticsearch reference current exploring your data html但是当我尝试运行指示
  • ElasticSearch 定义自定义映射与默认“_doc”映射冲突

    尝试创建自定义映射类型时会发生此问题 为第一个插入弹性创建自定义映射后想要创建 doc映射类型和冲突就发生在这里 第一步我创建一个映射 mappings properties field1 type keyword field2 type
  • 将 ElasticSearch SearchResponse 对象转换为 JsonObject

    我想将elasticsearch搜索结果转换为Json对象 我还没有找到任何直接转换的正确方法 SearchResponse response client prepareSearch index setExplain true execu
  • 在弹性搜索中使用 GET/POST 时的不同结果

    我正在通过 Elastic Search Head 插件尝试弹性搜索 当我通过 POST 提交查询时 结果符合预期 但是 当我使用 GET 尝试相同的查询时 我总是会返回索引中的所有值 那么 如何通过 GET 将查询传递到弹性搜索服务器 以
  • Nest Elastic - 构建动态嵌套查询

    我必须使用 Nest 查询嵌套对象 但是查询是以动态方式构建的 下面的代码演示了以静态方式对嵌套 书籍 进行查询 QueryContainer qry qry new QueryStringQuery DefaultField name D
  • 从 node.js 创建对 AWS ES 实例的有效签名请求

    我试图找到一个示例 说明如何连接到 Node js 中的 AWS ES 实例 然后通过一个简单的请求访问 ES 集群 我正在尝试使用elasticsearch节点包 https www npmjs com package elasticse
  • Elasticsearch 数组必须和must_not

    我的 elasticsearch 数据库中有一个如下所示的文档 tags gt tag 1 tag 2 tag 3 tag A created at gt 2013 07 02 12 42 19 UTC label gt Mon super
  • NEST 1.0:请参阅 Fiddler 上的请求

    我刚刚更新到 NEST 1 0 我在远程服务器 不是本地主机 上有 Elastic Search 通常我在使用 Fiddler 发送和接收请求时没有任何问题 更新后 bammm 没有检测到任何请求 但我的应用程序发出这些请求没有任何问题 你
  • Elasticsearch 无法写入日志文件

    我想激活 elasticsearch 的日志 当我运行 elasticsearch 二进制文件时 我意识到我在日志记录方面遇到问题 无法加载配置 这是输出 sudo usr share elasticsearch bin elasticse

随机推荐

  • 《阿甘正传》英文原版剧本(场景+台词)(看电影学英语的最佳材料)

    当前在我朝可以下载到的 阿甘正传 的视频对应的所有版本的字幕 貌似都是字幕制作者听出来的结果 客气地说 这些版本的字幕都是不 完整 的 或者说 都是错误百出 当然 这对理解电影的剧情影响不大 但是 如果想通过看电影学英语的话 如此质量的字幕
  • linux 下各个4K区块文件大小测试速度对比 机械硬盘性能 64K性价比收益最高

    机械硬盘 每个区块取三次数最小值为准 带2G RAM缓存卡4K3 4 MB 秒8K7 3 MB 秒16K9 5 MB 秒32K16 7 MB 秒64K44 2 MB 秒128K67 1 MB 秒256K100 MB 秒512K139 MB
  • 爬虫的代理IP池写哪里了?

    亲爱的程序员小伙伴们 想要提高爬虫效率和稳定性 组建一个强大的代理IP池是非常重要的一步 今天我就来和你分享一下 代理IP池到底应该写在哪里 以及如何打造一个令人瞩目的代理IP池 准备好了吗 一起看看吧 一 代理IP池的代码位置选择 1 写
  • web基础与HTTP协议

    web基础与HTTP 一 web基础 1 DNS与域名 1 1域名 1 2 域名注册 1 3 DNS 解析 1 4 域名 二 网页的概念 1 网页 HTTP HTTPS 2 1网页基本概念 2 2 HTML 概述 2 2 1 HTML超文本
  • C++模板详解(函数模板、类模板)

    hello 这里是bangbang 今天来讲下模板 目录 1 泛型编程 2 函数模板 2 1 函数模板概念 2 2 函数模板格式 2 3 函数模板的实例化 2 4 模板参数的匹配原则 3 类模板 3 1 类模板定义格式 3 2 类模板实例化
  • cmake-3.19.2源码编译与安装

    1 介绍 和 编译环境 1 介绍 cmake是跨平台且开源的编译工具 支持如下7种平台 其他平台不认识没关系 认识linux就行 Microsoft Windows Apple macOS Linux FreeBSD OpenBSD Sol
  • 【转】局域网速度测试 三款软件轻松搞定

    局域网络可谓随处可见 我们也十分关注其实际运行速度如何 比如两台计算机间的文件传输 访问对方计算机的快慢等 而决定局域网络速度的因素很多 又不可能通过简单的操作检测出速度的大小 同时也希望能有一些软件能帮助我们治理局域网 以方便故障的排查
  • Redis系列--主从复制

    一 redis主从复制介绍 在 Redis 复制的基础上 使用和配置主从复制非常简单 能使得从 Redis 服务器 下文称 slave 能精确得复制主 Redis 服务器 下文称 master 的内容 每次当 slave 和 master
  • 五分钟学会python_Python可视化

    微信公众号 Python读财 如有问题或建议 请公众号留言 Seaborn是基于matplotlib的Python可视化库 它提供了一个高级界面来绘制有吸引力的统计图形 Seaborn其实是在matplotlib的基础上进行了更高级的API
  • idea 常用 插件备份

    一 java 序号 强烈推荐 插件名称 功能描述 使用 1 IDE Eval Reset idea 无限7天 续杯 你懂得 插件 2 CodeGlance2 在滚动条边上显示代码文件内容缩略图 可以快速定位到指定位置 3 Alibaba C
  • Tensorflow2.0 tf.keras.Model.load_weights() 报错处理

    错误描述 保存模型 model save weights model h5 脚本重启 加载模型 model load weights model h5 模型报错 ValueError You are trying to load a wei
  • PySide2 QTableWidget常用方法

    QTableWidget 设置列宽模式 设置列宽模式为自动调整 自动拉伸列宽填充窗口 无法手动调整 self tableWidget horizontalHeader setSectionResizeMode QHeaderView Str
  • 个人sublime配色方案

    文章目录 1 效果图 2 描述文件 1 效果图 2 描述文件 color scheme Packages Color Scheme Default Monokai tmTheme font face Consolas font size 1
  • 顺序查找

    顺序查找 基本思想 1 顺序查找 线性查找 从线性表的一端向另一端逐个将记录与给定值进行比较 若相等 则查找成功 给出该记录在表中的位置 若整个表检测完仍未找到与给定值相等的记录 则查找失败 给出失败信息 例子 int SeqSearch1
  • ad10怎么挖铺的铜_跟我学丨覆铜这样操作快!准!狠

    所谓覆铜 就是将PCB上闲置的空间作为基准面 然后用固体铜填充 这些铜区又称为灌铜 覆铜的意义在于 减小地线阻抗 提高抗干扰能力 降低压降 提高电源效率 与地线相连 减小环路面积 那么如何使用立创EDA覆铜呢 一 在PCB工具对话框里面 选
  • 2021-湖湘杯final-Web

    2021 湖湘杯final Web 前言 今年湖湘报的社企组的结果就是最后只能摆烂 然后决赛那段时间正好在复习期末 然后考完了想好好的休息一段时间 打游戏打累了再来复现一下湖湘杯final的题目放松放松 vote 今年HTB的基本上算是原题
  • javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint

    java 验证出现如下错误 javax validation UnexpectedTypeException HV000030 No validator could be found for constraint 错误原因 Java实体类中
  • 区块链的运行流程梳理记录

    目录 0 比特币交易流程 1 生成交易 2 网络传播与验证 3 交易池管理 4 交易优先级排序 5 交易手续费定价 6 共识竞争与构建区块 7 难度调整机制 8 分叉处理与主链判断 0 比特币交易流程 从交易的生命周期来看 比特币系统的交易
  • Is Usb Drive () ? DeviceIoControl, IOCTL_STORAGE_QUERY_PROPERTY

    http banderlogi blogspot com 2011 06 enum drive letters attached for usb html typedef enum STORAGE BUS TYPE BusTypeUnkno
  • Elasticsearch 相关度评分TF&IDF算法揭秘

    1 算法介绍 relevance score算法 简单来说 就是计算出 一个索引中的文本 与搜索的文本 他们之间的关联匹配程序 ElasticSearch使用的是term frequency inverse document frequen