【问题标题】:How does a JSON object gets tokenized and indexed in ElasticsearchJSON 对象如何在 Elasticsearch 中被标记化和索引
【发布时间】:2019-03-27 23:44:38
【问题描述】:

我最近开始研究 Elasticsearch,但无法弄清楚 JSON 对象是如何被标记化并存储在倒排索引中的。

考虑下面的 JSON 已经插入。

{
    "city": "Seattle",
    "state": "WA",
    "location": {
        "lat": "47.6062095",
        "lon": "-122.3320708"
    }
}

我可以像这样执行 URI 搜索

GET /my_index/_search?q=city:seattle

这个搜索会返回上面的文档,但是 Elasticsearch 怎么能只在 'city' 字段中搜索 'seattle' 呢?如果它对完整的JSON进行token化,所有的key和value都会被分离,那么key token和value token之间的映射关系是如何维护的。

【问题讨论】:

    标签: elasticsearch elastic-stack


    【解决方案1】:

    因为索引标记指向原始文档,该文档也被存储。 查看弹性文档中的Inverted Index

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-01
      • 2020-01-09
      • 1970-01-01
      • 2018-01-15
      • 2017-06-28
      • 1970-01-01
      • 2017-10-06
      • 2015-07-05
      相关资源
      最近更新 更多