当type声明为string,Elasticsearch 6.0将显示此错误.
"name" => [
"type" => "string",
"analyzer" => "ik_max_word"
]
Run Code Online (Sandbox Code Playgroud) 我的代码在elasticsearch 5中工作得很好但是当我从5升级到6然后.它正在显示
org.elasticsearch.common.transport.InetSocketTransportAddress not found
Run Code Online (Sandbox Code Playgroud)
完整的堆栈跟踪:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project elastic-store: Compilation failure
[ERROR] /home/elastic/elastic-store/src/main/java/com/qw/psence/store/es/common/ESClient.java:[12,42] cannot find symbol
[ERROR] symbol: class InetSocketTransportAddress
[ERROR] location: package org.elasticsearch.common.transport
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles: …Run Code Online (Sandbox Code Playgroud) 我是Elastic search的新手,我正在尝试使用whitespace Analyzer创建一个Completion建议器的演示.
根据Whitespace Analyzer的文档,它会在遇到空白字符时将文本分解为术语.所以我的问题是它是否也适用于完成建议者?
所以对于我的完成建议器前缀:"ela", 我期待输出为"Hello elastic search".
我知道一个简单的解决方案是添加多字段输入:
"suggest": {
"input": ["Hello","elastic","search"]
}
Run Code Online (Sandbox Code Playgroud)
但是,如果这是解决方案那么使用分析仪的意义是什么?分析仪在完成建议中是否有意义?
我的映射:
{
"settings": {
"analysis": {
"analyzer": {
"completion_analyzer": {
"type": "custom",
"filter": [
"lowercase"
],
"tokenizer": "whitespace"
}
}
}
},
"mappings": {
"my-type": {
"properties": {
"mytext": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"suggest": {
"type": "completion",
"analyzer": "completion_analyzer",
"search_analyzer": "completion_analyzer",
"max_input_length": 50
}
}
}
}
} …Run Code Online (Sandbox Code Playgroud) autocomplete autosuggest elasticsearch elasticsearch-analyzers elasticsearch-6
我的文件是按类别组成的。有40种不同的类别将这些类别手动添加到数据库中的文档中并建立索引。这是我的文档的样子:
{
"name": "..",
"categoryA": "..",
"categoryB": "..",..
"categoryDecayScore": 0.0 - 1.0
}
Run Code Online (Sandbox Code Playgroud)
如果这些文件属于所有40个类别的一部分,则被认为覆盖良好。因此,要将所有类别的文档推到顶部,我想使用衰减函数来减少那些属于较少类别的文档的得分。
为此,我使用categoryDecayScore在索引时间设置的属性。如果文件是所有40个大类的一部分超过了它的categoryDecayScore将是0.0如果缺少一半,但有超过1/3它会得到一个分数0.2,如果它具有小于1/3它会得到一个分数0.3。
然后,我也增加categoryDecayScore了0.02,以减少相关分数。
我想做的是:
我希望文档categoryDecayScore > 0.0的分数越远,其得分越低0.0。
这是我的过滤器功能:
"filter": {
"exp": {
"categoryDecayScore" : {
"origin" : 0.0,
"scale" : 1.0,
"offset" : 0.0,
"decay" : 0.5
}
}
}
Run Code Online (Sandbox Code Playgroud)
我在这里了解文档的方式:
这origin是我的参考点,所有拥有的文档categoryDecayScore > 0.0将被衰减,任何具有的文档categoryDecayScore >= 1.0将被衰减0.5。
但是,从我的结果来看,这似乎并没有影响。前4个文档均具有相同的分数,但categoryDecayScore值如下:
{
_score: 51.970146, …Run Code Online (Sandbox Code Playgroud) 我正在寻找与 ES 版本兼容的语法/示例是 6.7。我看过文档,我没有看到任何例子,而且解释对我来说还不够清楚。我试过根据那个编写查询,但我一直收到语法错误。我已经看到以下关于 SO 的问题,但它们对我没有帮助:
布尔查询中的 should 过滤上下文(Elasticsearch)
它没有任何例子。
我收到语法错误
"type": "parsing_exception",
"reason": "no [query] registered for [filtered]",
"line": 1,
"col": 31
Run Code Online (Sandbox Code Playgroud)
也许它适用于不同版本的 ES。
我所需要的只是一个带有两个“或”条件的简单示例(我的是一个range和一个,term但我想这应该没什么关系),我都希望在过滤器上下文中使用(我不关心分数,也不关心分数)文本搜索)。
如果您真的需要它,我可以展示我的尝试(需要在发布之前从中删除一些“敏感”(duh)部分),但是它们会出现解析/语法错误,因此我认为它们没有任何意义。我知道没有表现出任何努力的问题被认为对 SO 不利,但我没有看到任何逻辑来显示甚至没有成功解析的尝试,任何示例都可以帮助我理解语法。
我在 elasticsearch 中遇到以下错误。
{"error":{"root_cause":[{"type":"circuit_breaking_exception","reason":"[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting","bytes_wanted":0,"bytes_limit":0}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"en_product_idx2","node":"eFSrhLqNTYubukyF3pz8aw","reason":{"type":"query_shard_exception","reason":"script_score: the script could not be loaded","index_uuid":"IFYbHBBjRxW188SKVh0c4Q","index":"en_product_idx2","caused_by":{"type":"general_script_exception","reason":"Failed to compile inline script [if (params['_source']['sku'] == \"black\") return 999; else return 434-params.ids.indexOf(doc['id'].value.intValue());] using lang [painless]","caused_by":{"type":"circuit_breaking_exception","reason":"[script] Too many dynamic script compilations within, max: [75/5m]; please use indexed, or scripts with parameters instead; this limit can be changed by the [script.max_compilations_rate] setting","bytes_wanted":0,"bytes_limit":0}}}}],"caused_by":{"type":"circuit_breaking_exception","reason":"[script] Too many …
随着Elasticsearch 6.0 中的映射类型被删除,我想知道文档的 ID 是否保证在索引中是唯一的?
假设我有三个索引,所有索引都有一个包含 ID 的“父”字段。在查找具有给定 ID 的文档时,我是否需要包含 ID 所属的索引,还是可以只搜索所有三个索引?
我正在尝试恢复已关闭的索引,但迄今为止任何尝试均未成功。
GET /_cat/indices/显示:
green open .fess_config.web_config m7yOnyvERje6baMyvi5IHA 2 0 1 0 10kb 10kb
close .suggest_analyzer fjKXYnKHSQOeVsqf_ETTVA
green open .fess_user.group jyu086_5QUKmx9N64EHsRQ 5 0 0 0 1.2kb 1.2kb
Run Code Online (Sandbox Code Playgroud)
GET /_cluster/health?level=indices&prettyfjKXYnKHSQOeVsqf_ETTVA根本不包含在其输出中。
启动日志中也没有提及任何1 。fjKXYnKHSQOeVsqf_ETTVA
GET /.suggest_analyzer/fjKXYnKHSQOeVsqf_ETTVA/_recovery?human并
GET /.suggest_analyzer/fjKXYnKHSQOeVsqf_ETTVA/_open得出结果:
{
"error": {
"root_cause": [{
"type": "index_closed_exception",
"reason": "closed",
"index_uuid": "fjKXYnKHSQOeVsqf_ETTVA",
"index": ".suggest_analyzer"
}
],
"type": "index_closed_exception",
"reason": "closed",
"index_uuid": "fjKXYnKHSQOeVsqf_ETTVA",
"index": ".suggest_analyzer"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud)
GET /_recovery?humanfjKXYnKHSQOeVsqf_ETTVA返回一切正常,但响应中再次没有提及。
*recovery文件系统上也没有文件:
[root@mmm indices]# ls -lR fjKXYnKHSQOeVsqf_ETTVA …Run Code Online (Sandbox Code Playgroud) 目前,在ES 5.6上,我们使用groovy内联脚本来获取给定文档中给定术语的tf,如 -
GET document/_search
{
"size": 114,
"query": {"terms": {
"doc_id": [1840, 2160]
}},
"script_fields": {
"tf": {
"script": {
"lang": "groovy",
"inline": "_index['text'][term_value].tf()",
"params": {
"term_value": "hello"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
所以它回复我的回应 -
"hits": {
"total": 36,
"max_score": 1,
"hits": [
{
"_index": "document",
"_type": "sample",
"_id": "41707",
"_score": 1,
"fields": {
"tf": [
3
]
}
}]
Run Code Online (Sandbox Code Playgroud)
但是在ES 6.0 groovy支持下降之后,似乎脚本引擎是唯一的解决方案,而且由于缺乏对Elasticsearch类和内部行为的正确理解,很难弄清楚实现.
基于Scripting Engine文档,我需要实现
private static class MyExpertScriptEngine implements ScriptEngine {
@Override
public String getType() {
return …Run Code Online (Sandbox Code Playgroud) elasticsearch elasticsearch-plugin elasticsearch-painless elasticsearch-6
如何在 AWS 环境中自动化 Kibana 保存对象的版本控制?
我在 AWS 上托管了一个 Elasticsearch 域,并且我已经配置了 Kibana 来可视化数据。现在,出于以下几个原因,我想对 Kibana 配置进行版本控制:
到目前为止,我发现的唯一解决方案包括几个手动步骤:
备份:
Saved Objects在 Kibana 管理控制台中选择选项卡Export Everything按钮恢复:
Index Patterns在 Kibana 管理控制台中选择选项卡Saved Objects在 Kibana 管理控制台中选择选项卡Import按钮并上传受版本控制的 .json 文件amazon-web-services elasticsearch kibana elasticsearch-6 kibana-6