elasticsearch-plugin

ElasticSearch - define custom letter order for sorting

拟墨画扇 提交于 2019-12-06 12:35:29
I'm using ElasticSearch 2.4.2 (via HibernateSearch 5.7.1.Final from Java). I have a problem with string sorting. The language of my application has diacritics, which have a specific alphabetic ordering. For example Ł goes directly after L , Ó goes after O , etc. So you are supposed to sort the strings like this: Dla Dła Doa Dóa Dza Eza ElasticSearch sorts by typical letters first, and moves all strange letters to at the end: Dla Doa Dza Dła Dóa Eza Can I add a custom letter ordering for ElasticSearch? Maybe there are some plugins for this? Do I need to write my own plugin? How do I start? I

Elastic Search Nested Query with Nested Object

青春壹個敷衍的年華 提交于 2019-12-06 09:11:58
问题 This is the type of data I have stored on my index in elastic search. I have to find Recipes with Main Ingredient Beef(and weight less than 1000) with Ingredients -(chilli powder and weight less than 250),(olive oil & weight less than 300 )and similarly for all other ingredients. "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

Elasticsearch Aggregation by Day of Week and Hour of Day

十年热恋 提交于 2019-12-06 07:04:34
I have documents of type: [{"msg":"hello", date: "some-date"},{"msg":"hi!", date: "some-date"}, ... I want to have the count of documents by day of week. For example x messages were sent on Monday and y were sent on Tuesday and so on. I have used date_histogram with aggregation but it returns me the documents day wise. It does return me the day, but say "Wed, 22" and "Wed, 29" are returned as separate aggregation documents. This is somewhat related to Elasticsearch - group by day of week and hour but there is no answer to that question so I am reposting it. According to the suggestion there it

How can I run script automatically after Docker container startup

冷暖自知 提交于 2019-12-05 16:02:12
I'm using Search Guard plugin to secure an elasticsearch cluster composed of multiple nodes. Here is my Dockerfile: #!/bin/sh FROM docker.elastic.co/elasticsearch/elasticsearch:5.6.3 USER root # Install search guard RUN bin/elasticsearch-plugin install --batch com.floragunn:search-guard-5:5.6.3-16 \ && chmod +x \ plugins/search-guard-5/tools/hash.sh \ plugins/search-guard-5/tools/sgadmin.sh \ bin/init_sg.sh \ && chown -R elasticsearch:elasticsearch /usr/share/elasticsearch USER elasticsearch To initialize SearchGuard (create internal users and assign roles). I need to run the script init_sg.sh

custom analyzer which breaks the tokens on special characters and lowercase/uppercase

送分小仙女□ 提交于 2019-12-04 06:07:54
问题 I am trying to write a custom analyzer which breaks the token on special characters and convert it into uppercase before indexing and I should be able to get result if I search with lowercase also.. for example if I am giving data@source - it should replace @ with whitespace - any special character it should replace with whitespace and give me result like data source. Here is how I tried implementing. PUT sound { "settings": { "analysis": { "analyzer": { "my_analyzer": { "tokenizer":

How to reindex ElasticSearch quickly?

血红的双手。 提交于 2019-12-04 05:48:25
I have an ElasticSearch index with around 200M documents, total index size of 90Gb. I changed mapping, so I would like ElasticSearch to re-index all the documents. I wrote a script that creates a new index (with the new mapping), then goes over all the documents in the old index and puts then into the new one. It seems to work, but the problem is that it works extremely slowly. It started with 300 documents / minute two days ago, and now the speed is 150 documents/minute. The script runs on a machine within the same network the elastic search machines in. With such speed it will require a

How to use the official docker elasticsearch container?

回眸只為那壹抹淺笑 提交于 2019-12-03 03:58:37
问题 I have the following Dockerfile: FROM docker.elastic.co/elasticsearch/elasticsearch:5.4.0 RUN elasticsearch EXPOSE 80 I think the 3rd line is never reached. When I try to access the dockercontainer from my local machine through: 172.17.0.2:9300 I get nothing, what am I missing? I want to access elasticsearch from the local host machine. 回答1: I recommend using docker-compose (which makes lot of things much easier) with following configuration. Configuration (for development) Configuration

what is the better way to index data from Oracle/relational tables into elastic search?

↘锁芯ラ 提交于 2019-12-03 00:22:06
What are the options to index large data from Oracle DB to elastic search cluster? Requirement is to index 300Million records one time into multiple indexes and also incremental updates having around approximate 1 Million changes every day. I have tried JDBC plugin for elasticsearch river/feeder , both seems to be running inside or require locally running elastic search instance. Please let me know if there is any better option for running elastic search indexer as a standalone job (probably java based). Any suggestions will be very helpful. Thanks. We use ES as a reporting db and when new

logstash index a text file

微笑、不失礼 提交于 2019-12-02 22:39:16
问题 I'd like to import a text file in Elasticsearch. The text file contains 3 values per line. After spending several hours of struggling, I didn't get it done. Help is greatly appreciated. Elasticsearch 5.4.0 with Logstash installed. Sample data: username email hash username email hash username email hash username email hash username email hash also built a python script but its too slow: import requests import json from elasticsearch import Elasticsearch es = Elasticsearch([{'host': 'localhost'

How to use the official docker elasticsearch container?

雨燕双飞 提交于 2019-12-02 17:47:05
I have the following Dockerfile: FROM docker.elastic.co/elasticsearch/elasticsearch:5.4.0 RUN elasticsearch EXPOSE 80 I think the 3rd line is never reached. When I try to access the dockercontainer from my local machine through: 172.17.0.2:9300 I get nothing, what am I missing? I want to access elasticsearch from the local host machine. I recommend using docker-compose (which makes lot of things much easier) with following configuration. Configuration (for development) Configuration starts 3 services: elastic itself and extra utilities for development like kibana and head plugin (these could