使用 shuf 来打乱一个文件中的行或是选择文件中一个随机的行。

同一字段中相同内容,term_vector结果不同,为什么

Elasticsearch | 作者 xhy2298963035 | 发布于2018年07月02日 | 阅读数:2341

定义了一个tags字段 类型是text用逗号分词 但是最后产生的term_vector完全不同,morelikethis就会产生不同的结果
 
{"_index":"test","_type":"watchingtags","_id":"47E263D6-D035-424E-8C23-38B1516AFE7A","_version":1,"found":true,"took":0,"term_vectors":{"tags":{"field_statistics":{"sum_doc_freq":64,"doc_count":14,"sum_ttf":64},"terms":{"朋友":{"term_freq":1},"朋友圈":{"term_freq":1},"欢乐精选":{"term_freq":1},"飞碟":{"term_freq":1},"高调":{"term_freq":1}}}}}
{"_index":"test","_type":"watchingtags","_id":"87625F5D-1D97-4D09-851E-C067BFA87429","_version":1,"found":true,"took":0,"term_vectors":{"tags":{"field_statistics":{"sum_doc_freq":93,"doc_count":23,"sum_ttf":101},"terms":{"朋友":{"term_freq":1},"朋友圈":{"term_freq":1},"欢乐精选":{"term_freq":1},"飞碟":{"term_freq":1},"高调":{"term_freq":1}}}}}

{"_index":"test","_type":"watchingtags","_id":"21f977ec6d726e8abeee015f098e1f86","_version":1,"found":true,"took":0,"term_vectors":{"tags":{"field_statistics":{"sum_doc_freq":93,"doc_count":23,"sum_ttf":101},"terms":{"朋友":{"term_freq":1},"朋友圈":{"term_freq":1},"欢乐精选":{"term_freq":1},"飞碟":{"term_freq":1},"高调":{"term_freq":1}}}}}

{"_index":"test","_type":"watchingtags","_id":"4fdbe864d435688590a2ecf696c7a15f","_version":1,"found":true,"took":0,"term_vectors":{"tags":{"field_statistics":{"sum_doc_freq":59,"doc_count":14,"sum_ttf":64},"terms":{"朋友":{"term_freq":1},"朋友圈":{"term_freq":1},"欢乐精选":{"term_freq":1},"飞碟":{"term_freq":1},"高调":{"term_freq":1}}}}}
已邀请:

rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk

赞同来自:

你的测试用例要完善下,想要重现都要靠猜……
把每一步的操作列出来,这样才方便大家帮你看问题

要回复问题请先登录注册