问题描述
我正在使用Carrot2和ElasticSearch。当我安装carrot2插件时,我有一个运行大量数据的弹性搜索服务器。想要获得几个基本问题的答案:
-
聚簇仅适用于新建索引的文档,甚至是旧文档?
-
我指定要查看哪些字段进行聚类?
-
curl命令正在工作并给出一些结果。如何获取curl命令,它将JSON作为输入到localhost的REST API URL:9200 / article-index / article / _search_with_clusters?.....
欣赏任何帮助。
是的,如果要直接从ES安装使用插件,则需要自行进行REST调用。我相信你在使用Python。请查看。这是一个令人愉快的REST工具,用于python。
要进行POST请求,您可以执行以下操作:
import json
url ='localhost:9200 / article-index / article / _search_with_clusters'
payload = {'some':'data'}
r = .post(url,data = json.dumps(payload))
print r.text
在查找更多信息。
I am using Carrot2 and ElasticSearch. I has elastic search server running with a lot of data when I installed carrot2 plugin.
Wanted to get answers to a few basic questions:
Will clustering work only on newly indexed documents or even old documents?
How can I specify which fields to look at for clustering?
The curl command is working and giving some results. How can I get the curl command which takes a JSON as input to a REST API url of the form localhost:9200/article-index/article/_search_with_clusters?.....
Appreciate any help.
Yes, if you want to use the plugin straight off the ES installation, you need to make REST calls of your own. I believe you are using Python. Take a look at requests. It is a delightful REST tool for python.
To make POST requests you can do the following :
import json
url = 'localhost:9200/article-index/article/_search_with_clusters'
payload = {'some': 'data'}
r = requests.post(url, data=json.dumps(payload))
print r.text
Find more information at requests documentation.
这篇关于Carrot2 + ElasticSearch基本信息流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!