【发布时间】:2017-01-15 18:26:09
【问题描述】:
我有大约 15,000 个抓取的网站,其正文存储在弹性搜索索引中。我需要获取所有这些文本中最常用的 100 个三词短语:
类似这样的:
Hello there sir: 203
Big bad pony: 92
First come first: 56
[...]
我是新手。我研究了术语向量,但它们似乎适用于单个文档。所以我觉得这将是术语向量和聚合与各种 n-gram 分析的组合。但我不知道如何实现这一点。任何指针都会有所帮助。
我当前的映射和设置:
{
"mappings": {
"items": {
"properties": {
"body": {
"type": "string",
"term_vector": "with_positions_offsets_payloads",
"store" : true,
"analyzer" : "fulltext_analyzer"
}
}
}
},
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
},
"analysis": {
"analyzer": {
"fulltext_analyzer": {
"type": "custom",
"tokenizer": "whitespace",
"filter": [
"lowercase",
"type_as_payload"
]
}
}
}
}
}
【问题讨论】:
标签: elasticsearch indexing lucene