代码之家  ›  专栏  ›  技术社区  ›  Nikhil Joshi

ElasticSearch 5.5.0:查找相关文档

  •  3
  • Nikhil Joshi  · 技术社区  · 9 年前

    在ElasticSearch 5.5.0中,我更喜欢这个子句,但找不到相关文档。我在ElasticSearch和description字段中有以下数据,其中包含大量大小的非索引数据>100万字节。像下面我有一万份文件。我如何找出一组相互匹配至少80%的文档:

    {
        "_index": "school",
        "_type": "book",
        "_id": "1",
        "_source": {
          "title": "How to drive safely",
          "description": "LOTS OF WORDS...The book is written to help readers about giving driving safety guidelines. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. LONG...."
        }
    }
    

    [ [1,30, 500, 8000], [2, 40, 199], .... ]
    

    我是否需要编写批处理并将每个文档与所有其他文档进行比较并构建输出集?

    请帮忙。

    1 回复  |  直到 9 年前
        1
  •  2
  •   alr    9 年前

    这个 more like this query minimum_should_match 80% . 然而 max_query_terms 这里还需要考虑参数。

    此外,在查询时执行此操作听起来非常缓慢。您可能需要重新考虑您的策略,并在索引时间对文档进行聚类/分组(这是一件非常定制的事情,您需要自己做),以便搜索变得更快。