我想尝试支持波兰语的 Elasticsearch,但我遇到了一些问题。我安装了Stempel Analysis Plugin,我正在尝试创建一个使用波兰语分析器的索引:
curl -XPUT localhost:9200/polisz -d '{
"mappings" : {
"_default_" : {
"properties" : {
"text_entry" : { "type": "string", "analyzer": "polish" }
}
}
}
}
'
Run Code Online (Sandbox Code Playgroud)
但是我收到一个关于未识别分析器的错误:
{
"status" : 400,
"error" : "MapperParsingException[mapping [_default_]]; nested: MapperParsingException[Analyzer [polish] not found for field [text_entry]]; "
}
Run Code Online (Sandbox Code Playgroud)
安装插件并重新启动 ES 后我应该做些什么吗?我找不到有关使用该插件的任何具体说明,所以也许我只是在做一些明显错误的事情?
关于如何设置环境的更多详细信息:我通过命令安装并运行带有 ES 和 kibana 的 docker 镜像:
docker pull minimum2scp/es-kibana
docker run -d -p 8080:80 -p 9200:9200 --name es minimum2scp/es-kibana
Run Code Online (Sandbox Code Playgroud)
我通过命令安装了 Stempel 插件:
host$ docker …Run Code Online (Sandbox Code Playgroud) 这是我在弹性搜索中存储在索引中的数据类型。我必须找到主要成分牛肉(重量小于 1000)的食谱和成分 -(辣椒粉和重量小于 250),(橄榄油和重量小于 300)以及所有其他成分类似。
"Name": "Real beef burritos",
"Ingredients": [
{"name": "olive oil",
"id": 27,
"weight": 200},
{"name": "bonion","id": 3,"weight": 300},
{"name": "garlic",
"id": 2,
"weight": 100
},
{"name": "chilli powder",
"id": 35,
"weight": 150},
{"name": "coriander",
"id": 40,
"weight": 600},
{"name": "tortillas",
"id": 41,
"weight": 700}
],"Main_ingredient": {
"type": "Beef",
"id": 101,
"weight": 1000
}}}
Run Code Online (Sandbox Code Playgroud)
索引的映射是
{"final":{"mappings":{"superb":{"properties":{"Cook Time":{"type":"long"},"Ingredients":{"type":"nested","properties":{"id":{"type":"short"},"name":{"type":"string"},"type":{"type":"string"},"weight":{"type":"short"}}},"Main_ingredient":{"properties":{"id":{"type":"long"},"type":{"type":"string"},"weight":{"type":"long"}}},"Name":{"type":"string"},"Prep Time":{"type":"long"},"Servings":{"type":"long"},"Tags":{"type":"string"},"Urls":{"type":"string"},"Views":{"type":"long"}}}}}}
Run Code Online (Sandbox Code Playgroud)
我的查询是
{
"query": {
"bool": {
"must": [
{ "match": { "Main_ingredient.type": "Beef" }},
{"range":{"Main_ingredient.weight":{"lte":1000}}},
{
"nested": {
"path": …Run Code Online (Sandbox Code Playgroud) querydsl elasticsearch elastic-map-reduce elasticsearch-plugin
我目前正在尝试编写一个 Elasticsearch 插件(主要用于测试目的),并且我正在努力处理 简单说明的文档:
这些示例提供了入门所需的基本知识。有关如何编写插件的更多信息,我们建议您查看本文档中列出的插件以获取灵感。
所以基本上,在找到了一些教程(除了maven部分之外彼此不同意)后,请参阅http://david.pilato.fr/blog/2016/07/27/creating-a-plugin-for-elasticsearch -5-dot-0-using-maven/和http://jfarrell.github.io(它们不继承相同的类)。
我实际上被困在从哪里开始,核心 elasticsearch 依赖项中有哪些组件可用,以及我应该如何加载我的插件。(我知道我可以通过测试和复古工程来研究它,我只是想知道是否有人对这个主题有好的建议)。
现在我的代码看起来像:
public class MyPlugin extends Plugin implements NativeScriptFactory{
//overriden methods
}
Run Code Online (Sandbox Code Playgroud)
我应该从那里去哪里?
非常感谢!
我正在使用 ElasticSearch,我想进行查询。
我有不同的模块:['a', 'b', 'c', 'd']. 其中a和 b有一个额外的值 ( companyId) 我需要过滤所有模块的文本,但我需要过滤companyIdjust fora和bnot for 模块c和d。
这看起来像这样:
SELECT * FROM my_table WHERE (modules in ('a', 'b') and companyId='myid') OR (modules in ('b', 'c'))
但我有这个:
client.search({
index: INDEX,
type: TYPE,
body: {
query: {
bool: {
must: {
match: { text: 'mytext' },
},
filter: [
{ terms: { module: ['a', 'b', 'c', 'd'] } },
{ …Run Code Online (Sandbox Code Playgroud) 我需要编写一些索引作业,每天运行一次,查询我们的Oracle数据库表并索引到ElasticSearch.由于存在表依赖性,因此有些表首先索引,其他表接下来.但是围绕索引编制过程,我需要增强进入ES索引的字段,以及登录我们的Oracle数据库表作业状态,甚至可能记录索引过程成功/失败的记录.
我可以使用Elastic Search插件JDBC-River吗?
我正在尝试为Elasticsearch设置Shield,但遇到了一些麻烦
当我尝试启动Elasticsearch时:
/usr/share/elasticsearch/bin/elasticsearch
Run Code Online (Sandbox Code Playgroud)
所有工作都按预期工作,但当我尝试启动/重启Elasticsearch时:
/etc/init.d/elasticsearch srart
Run Code Online (Sandbox Code Playgroud)
我有下面描述的错误
[2015-02-17 21:44:09,662][ERROR][shield.audit.logfile ] [Tusk] [rest] [authentication_failed] origin_address=[/192.168.88.17:58291], principal=[es_admin], uri=[/_aliases?pretty=true]
Run Code Online (Sandbox Code Playgroud)
操作系统:Ubuntu 12.04
Elasticsearch:1.4.3
Shield:1.0.1 Elasticsearch和Shield使用默认设置运行
elasticsearch logstash elasticsearch-plugin kibana elasticsearch-shield
我一直在尝试使用 Kibana-4 进行聚合,并且在聚合下拉列表中,有一种新型聚合说 "siginificant trems" 。有人会解释它是什么以及可视化它的最佳方式是什么?
我在elasticsearch.yml中配置了我的全局自定义分析器,这是我的配置:
index :
analysis :
analyzer :
titleAnalyzer :
type : custom
tokenizer : ik_max_word
filter : [titleSynoymFilter, englishStemmerFilter]
filter :
titleSynoymFilter :
type : synonym
synonyms_path : ../analysis/title_synonym.txt
englishStemmerFilter :
type : stemmer
name : english
Run Code Online (Sandbox Code Playgroud)
然后我通过运行命令测试我的分析器 $ echo 'A drop in the ocean'| http :5600/_analyze?analyzer=titleAnalyzer
但elasticsearch告诉我它找不到分析仪:
{
"error": {
"reason": "failed to find analyzer [titleAnalyzer]",
"root_cause": [
{
"reason": "[elastisearch][127.0.0.1:9300][indices:admin/analyze[s]]",
"type": "remote_transport_exception"
}
],
"type": "illegal_argument_exception"
},
"status": 400
}
Run Code Online (Sandbox Code Playgroud) 我是EKL Stack的新手,对于我的项目,我们要求将kibana集成到我们的自定义应用程序仪表板中。因此,我们正在通过logstash捕获数据,并能够在kibana中看到它们。但是根据我们的要求,我们必须将kibana集成到本地应用程序仪表板中,因此,在单击某些链接时,我们应该打开页面并在应用程序中显示图形。因此有可能将show kibana图表集成到我们的自定义应用程序中。或者我们必须查询弹性搜索并创建与kibana类似的UI来显示趋势。
提前致谢。
一个月前我遇到了这个Github:https://github.com/taraslayshchuk/es2csv
我在Linux ubuntu中通过pip3安装了这个软件包.当我想使用这个包时,我遇到了这个包适用于python2的问题.我深入研究了代码,很快就发现了问题.
for line in open(self.tmp_file, 'r'):
timer += 1
bar.update(timer)
line_as_dict = json.loads(line)
line_dict_utf8 = {k: v.encode('utf8') if isinstance(v, unicode) else v for k, v in line_as_dict.items()}
csv_writer.writerow(line_dict_utf8)
output_file.close()
bar.finish()
else:
print('There is no docs with selected field(s): %s.' % ','.join(self.opts.fields))
Run Code Online (Sandbox Code Playgroud)
代码检查了unicode,这在python3中是不必要的.因此,我将代码更改为下面的代码.因此,该软件包在Ubuntu 16下正常运行.
for line in open(self.tmp_file, 'r'):
timer += 1
bar.update(timer)
line_as_dict = json.loads(line)
# line_dict_utf8 = {k: v.encode('utf8') if isinstance(v, unicode) else v for k, v in line_as_dict.items()}
csv_writer.writerow(line_as_dict)
output_file.close()
bar.finish()
else:
print('There …Run Code Online (Sandbox Code Playgroud)