2018-10-22         King

elastic search multi-fields matching problem

I have a query for elastic search.I am writing a query like this.$params = [ 'index' => config('elasticsearch.index'), 'type' => $this->type, 'body' => [ 'query' => [ 'multi_match' => [ 'query' => 'newyork john', 'type'=>'cross_fields', 'fields'=>['user','surname','location'], 'tie_breaker'=>'0.3', 'minimum_should_match'=>'10%', ] ...

 elasticsearch                     1 answers                     13 view
 2018-10-22         Nancy

Is there a way to optimize this CrateDB relational query?

I am testing CrateDB with a data set of 80 million events sent from a web app, both as a normalized, relational solution, and also as a denormalized, single database solution.I imported all 80 million denormalized events into a table, and ran the following aggregation query:select productName, SUM(elapsed)/60 as total_minutes from denormalizedwhere country_code = 'NL' AND eventType = 'mediaPlay' group by productNameorder by total_minutes desclimit 1000;and the query took .009 seconds. Wowza! CrateDB is blazing fast!Then I imported the sessionwide docs into one table called ...

 elasticsearch                     1 answers                     15 view
 2018-10-22         Rudolf

Elasticsearch scoring based on how close a number is to a query

I want to score my documents based on on how close a number is to a query. Given I have two documents document1.field = 1 and document2.field = 10, a query field = 3 then I want document1._score > document2._score. Or in other words I want something like a fuzzy query against number. How would I achieve this? The use case is I want to support price queries (exact or range), but want to rank stuff that isn't exactly in the boundaries. It can be implemented using custom_score query where script will determine boost depending on absolute value of the difference between ...

 elasticsearch                     2 answers                     20 view
 2018-10-22         Burnell

Create elastic.js query

Long story short.I need to create an analogue with elasticjs for query:http://example.com/one/two/_search?q=tags:three*I'm confused with options listed on the docs page. Already tried to create BoolQuery, TermQuery and a couple of others, but they don't work for me.I'm stuck now and would appreciate any kind of help on subject.P.S. And another side of the same question. I can't find how json should look to obtain the same data. Came up with this solution so far, but unfortunately it's not working: { "query": { "bool": { "should": [ { "term": { ...

 elasticsearch                     1 answers                     24 view
 2018-10-22         Sandy

extract numbers from json with logstash and send to elasticsearch

I'm trying to parse a json log containing numbers, although represented as strings e.g. {"metric":"123"}and I have tens of such metric values.Is there any way to configure the json filter to interpret all fields as numbers? or any way to mutate them without having to specify every single one of them?In parallel I'm trying to have the source of such message send a number in the json instead, e.g. {"metric":123}which does show up on elasticsearch as a number field, but this may become harder than making this change in logstash if possible.any suggestions? Indeed as Val ...

 elasticsearch                     1 answers                     27 view
 2018-10-22         Buck

Delete all index except one/some in Elasticsearch?

Is there any way to delete all indices except one?We can use the metadata _index of document in a GET request:GET _count{ "query": { "match": { "_index": "indexname" } }}The above query doesn't make sense but just to show that we can use _index inside a query I have mentioned it. I have tried the below query, but I guess _all API doesn't support query. DELETE _all{ "query" : { "bool" : { "must_not" : [ { "match": { "_index": "indexname" } } ] } }}Is there any way to delete all indices except one/some without using bulk API ? ...

 elasticsearch                     1 answers                     29 view
 2018-10-22         Gavin

Lowercase Document Type during Nest search of Elasticsearch cluster

I'm searching a v5.5 elasticsearch cluster that's hosted using AWS's managed solution. I'm using a client to send search requests to the cluster but it's not finding any hits. I switched on the cluster lever logging and can see that the problem is that the type being searched is in lowercase (when the document types in the index are uppercase) so it can't match on any documents.I'm passing a search descriptor object into the Nest client:GetSearchDescriptor(SearchDescriptor<T> descriptor){ descriptor.Index(index) .Type(documentType) ...

 elasticsearch                     1 answers                     28 view
 2018-10-22         Trista

Elasticsearch advanced autocomplete

I want to autocomplete user input with Elasticsearch. Now There are tons of tutorials out there how to do so, but none go into the really detailed stuff.The last issue I'm having with my query is that it should score Results that are not real "autocompletions" lower. Example:IS:I type: "Bed"I find: "Bed", "Bigbed", "Fancy Bed", "Bed Frame"WANT:I type: "Bed"I find: "Bed", "Bed Frame", [other "Bed XXX" results], "Fancy Bed", "Bigbed"So i want Elasticsearch to first complete "to the right" if that makes sense. And then use results that have words in front of it.I've tried the ...

 elasticsearch                     1 answers                     31 view
 2018-10-22         Lisa

Wildcard doesn't work as expected when querying by more than a word

If I search documents containing e.g "called" in "message" field I get an expected result, but when I search for "was called", "was called*" or "*was called*"I get nothing, although I have a lot of documents whose message field contains the following content "Application was called by REST API". Here is a part of a query I send:"wildcard": { "message": { "wildcard": "was called", "boost": 1.0 }}Here is a part of the mapping:"mappings": { "doc": { "dynamic_templates": [ { "message_field": { "path_matc...

 elasticsearch                     1 answers                     31 view
 2018-10-22         Alma

Aggregation of aggregation in Kibana visualization

I am trying to add some metrics on top of a set of aggregations in Kibana, however I do not know to do that. For example, my data looks like:{{"A": 12, "B": 15, "month": "July" }, {"A": 5, "B": 98, "month": "August"}, {"A": 54, "B": 21, "month": "July" }, {"A": 53, "B": 4, "month": "August"}, {"A": 15, "B": 24, "month": "August"}, {"A": 45, "B": 33, "month": "July" }, {"A": 25, "B": 56, "month": "August"}, {"A": 8, "B": 23, "month": "August"}, {"A": 7, "B": 78, "month": "July" }}I want to draw a line graph to show SUM(A)/SUM(B) over months. So the Y axis is SUM(A)/...

 elasticsearch                     1 answers                     63 view
 2018-10-22         Bertha

elasticsearch can not create index

The version I installed the ELK is 6.3.2. echo '[elasticsearch-6.x] name=Elasticsearch repository for 6.x packages baseurl=https://artifacts.elastic.co/packages/6.x/yum gpgcheck=1 gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch enabled=1 autorefresh=1 type=rpm-md' > /etc/yum.repos.d/elasticsearch.repoyum install -y java-1.8.0-openjdk logstash elasticsearch kibana.the logstash setting like this input { file { path => "/data/logs/**/messages" type => "syslog" } } output { elasticsea...

 elasticsearch                     1 answers                     88 view
 2018-10-22         Tracy

Elasticsearch sort date after aggregation

I need to find related or similar posts and then sort them by date. How can I do that?here is a query : { "fields":[ "id", "score" ], "size":0, "query":{ "function_score":{ "query":{ "bool":{ "should":[ { "match":{ "main_headline.en":{"query":"some text"}}}, {"match":{"body.en":"some text" }} ], "must_not":{ "term":{ "id":76484 }} } }, "functions":[ { "gauss":{ "published_at":{ "scale":"140w","decay":0.3 } } }] } }, "aggrega...

 elasticsearch                     1 answers                     12 view
 2018-10-22         Jeffrey

Can an Elasticsearch rollup job dynamically create indexes like Logstash does?

I am currently testing out the new rollup APIs in Elasticsearch 6.3 and am wondering if there is any way to configure the rollup job to dynamically create an index based on timestamp like Logstash does when ingesting data? The use case is to try and roll up large amounts of time series network performance reporting data and I'm worried that even an hourly rollup will create a huge index to manage so am looking to split it to have one index for each day's hourly rollup.Current rollup job config:{ "index_pattern": "dxs-raw-*", "rollup_index": "dxs-hourly-%{+YYYY.MM.dd}"...

 elasticsearch                     1 answers                     25 view
 2018-10-22         Abraham

Kafka connect elastic search ID creation for multiple fields not working

I am asking this question as there was no answer in the original case: Elastic Kafka Connector, ID Creation.I have a similar situation.Elastic search table to create a record for a single field, but not for multiple fields when request sent through kafkaconnect.Getting exception "Key is used as document id and can not be null" in elastic search.My Connector Configurations:{ "name": "test-connector33", "config": { "connector.class":"io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", "tasks.max": "1", "topics": "test-connector33", "connection.url": "http://localh...

 elasticsearch                     1 answers                     102 view
 2018-10-22         Reginald

Using Elasticsearch + Logstash to push aggregated statistics to Kafka

We're playing with Kafka, Elasticsearch and Logstash. For the sake of experimentation, we would like to build a small service that:Produce "click" messages when a user click on a given link, and push them to KafkaIndex those click messages into ElasticsearchAggregate those click messages and push them to Kafka.At this point we've got the service that produce click messages and push them into a Kafka topic, and we're using Logstash to read these messages and push them into Elasticsearch.What we need now is a way to produce new Kafka messages containing aggregated results. We...

 elasticsearch                     1 answers                     83 view
 2018-10-22         Toby

Elasticsearch Error - Cluster health status changed from [YELLOW] to [RED] (reason: [shards failed

I am using elasticdump to dump a huge dataset into an elasticsearch node with the command : elasticdump --input=./xyz.json --output=http://localhost:9200/ . Everything goes normal but after some time I see these error messages in the console: _type: 'doc',_id: 'lzHMQmUBQ1VCv6VBROQA',status: 503,error:{ type: 'unavailable_shards_exception', reason: '[logstash-2018.08.16][2] primary shard is not active Timeout: [1m], request: [BulkShardRequest [[logstash-2018.08.16][2]] containing [31] requests]' } }On inspection of the elasticsearch logs, the following errors are visible :[2...

 elasticsearch                     1 answers                     20 view

Page 1 of 96  |  Show More Pages:  Top Prev Next Last