gpt4 book ai didi

elasticsearch - 查询elasticsearch以分析文本

转载 作者:行者123 更新时间:2023-12-03 02:04:59 24 4
gpt4 key购买 nike

我如何从此Elasticsearch REST查询中转换:

http://x.x.x.x:9200/_analyze?analyzer=standard&text="text text text"

进入Java API客户端?

我测试了:
client.prepareSearch("index").setQuery("_analyze?analyzer=standard&text='text text text'").execute().actionGet()

但这不起作用

谢谢

最佳答案

应该这样做:

AnalyzeResponse analyzeResponse = client.admin().indices().prepareAnalyze("my_index", "text text text").setAnalyzer("standard").execute().actionGet();

如有疑问,请查看Elasticsearch自己的测试代码中的 this类。

关于elasticsearch - 查询elasticsearch以分析文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27316461/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com