1

在制定基本的 elasticutils 搜索查询时需要帮助

我正在尝试测试elasticutils,主要是因为我无法获得#searches 结果/秒的最佳性能。(更多细节:这里

到目前为止,这是我所做的。

es=get_es(hosts=['localhost:9200'],timeout=30,default_indexes=['ncbi_taxa_names'],dump_curl=CurlDumper())


es.get_indices()
# [2012-08-22T15:36:10.639102]
curl -XGET
 http://localhost:9200/ncbi_taxa_names/_status
Out[26]: {u'ncbi_taxa_names': {'num_docs': 1316005}}

S().indexes('ncbi_taxa_names').values_dict()
Out[27]: [{u'tax_name': u'Conyza sp.', u'tax_id': u'41553'}, ...

所以我想要做的是制定一个查询,我可以在其中搜索 {“taxa_name”:“cellvibrio”},然后与 pyes 相比,我可以使用 elasticutils 检索多少搜索结果。

可能与 ES 在本地运行的方式有关,而与 API 无关。

更新1

我尝试了以下方法,搜索结果仍然与我从 pyes 得到的结果非常相似。现在我开始怀疑它是否与本地 ES 的运行方式有关。仍然需要帮助解决这个问题。

es=get_es(hosts=['localhost:9200'],timeout=30,default_indexes=['ncbi_taxa_names'],dump_curl=CurlDumper())


es.get_indices()
# [2012-08-22T15:36:10.639102]
curl -XGET
 http://localhost:9200/ncbi_taxa_names/_status
Out[26]: {u'ncbi_taxa_names': {'num_docs': 1316005}}

s=S().indexes('ncbi_taxa_names').values_dict()
Out[27]: [{u'tax_name': u'Conyza sp.', u'tax_id': u'41553'}, ...

results = s.query(tax_name='aurantiacus')  # using elasticutils

感谢你的帮助。

谢谢!

4

0 回答 0