elasticsearch-5

Using an id of a table for sql_last_value in logstash?

无人久伴 提交于 2019-12-23 03:47:08
问题 I'm having a MySQL statement as such within my jdbc plugin in logstash input. statement => "SELECT * from TEST where id > :sql_last_value" My table doesn't have any date or datetime field as such. So I'm trying to update the index, by checking minute by minute using a scheduler , whether any new rows have been added to the table. I should only be able to update the new records, rather than updating the existing value changes from an existing record. So to do this I'm having this kinda of a

How to match a phrase in elastic-search with expandable prefix and suffix?

与世无争的帅哥 提交于 2019-12-22 01:21:49
问题 We have a use case in which we want to match phrases in elastic-search, but in addition to phrase query we also want to search partial phrases. Example: Search phrase: "welcome you" or "lcome you" or "welcome yo" or "lcome yo" this should match to documents containing phrases: "welcome you" "we welcome you" "welcome you to" "we welcome you to" i.e. we want to maintain the ordering of words by doing a phrase query with added functionality that is returns us results which contains phrase as a

Extract record from multiple arrays based on a filter

人盡茶涼 提交于 2019-12-18 07:14:46
问题 I have documents in ElasticSearch with the following structure : "_source": { "last_updated": "2017-10-25T18:33:51.434706", "country": "Italia", "price": [ "€ 139", "€ 125", "€ 120", "€ 108" ], "max_occupancy": [ 2, 2, 1, 1 ], "type": [ "Type 1", "Type 1 - (Tag)", "Type 2", "Type 2 (Tag)", ], "availability": [ 10, 10, 10, 10 ], "size": [ "26 m²", "35 m²", "47 m²", "31 m²" ] } } Basically, the details records are split in 5 arrays, and fields of the same record have the same index position in

ElasticSearch 5: MapperParserException while Inserting data

╄→尐↘猪︶ㄣ 提交于 2019-12-13 20:25:58
问题 My initial mapping was { "vehiclemodel": { "properties": { "price": { "type": "double" } } } } Later I updated the mapping with below { "vehiclemodel": { "properties": { "price": { "type": "double", "fields": { "exShowroomPrice": { "type": "double" } } } } } } Now when I add Data1 it getting added, but when I add Data2 it throws below exception Data1 : { "price": 36992043 } Data2 : { "price": { "exShowroomPrice": 36992043 } } Exception : { 'index': { '_index': 'notes', '_type': 'vehiclemodel'

How to write an Elasticsearch query involving contains-all-of, contains-one-of, contains-exactly and not-contains operations?

早过忘川 提交于 2019-12-13 10:34:52
问题 I have documents like this: { 'body': '', 'date': '', } I want to get documents with these conditions: body contains all of: ['a', 'b', 'c'] and contains one of: ['d', 'e', 'f'] and contains exactly these phrases: ['g h i', 'j k l'] and not contains: ['m', 'n'] How can I create this query? 回答1: You need to use bool queries. Important to note that for your "contains exactly these phrases" how that works depends on what analyzers you have applied to the body field. https://www.elastic.co/guide

How to update Elasticsearch 1.x to 5.x queries?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 09:51:42
问题 I have a query in Elasticsearch 1.x like this: {"filter": {"and": {"filters": [{"exists": {"field": "body"}}, {"query": {"term": {"accept": "true"}}}, {"exists": {"field": "thumbnail"}}, {"query": {"terms": { "content": ["577f6ca06dd5340a97e89923"]}}}, {"range": { "date": {"lt": "2018-01-05T04:07:48.901933", "gte": "1963-04-04T04:07:48.901933"}}}, {"query": {"terms": { "agency": ["577ff7176dd5340a97e899b7"]}}}, {"query": {"terms": { "subject": ["578c6c7f6dd5345f3db18e7b"]}}}, {"query": {

Reindex data from Elasticsearch 1.X to ElastichSearch with old _timeStamp to new Field

匆匆过客 提交于 2019-12-13 07:27:18
问题 I am trying to migrate my data from an old Elasticsearch(Version 1.4.4) Cluster to a new one (5.1) I am using the reindex api in the new Elasticsearch, but can't get the old _timestamp to a new field timestamp . Everything else works fine. POST _reindex { "source": { "remote": { "host": "http://oldhost:9200" }, "index": "source", "query": { "match_all": {} } }, "dest": { "index": "dest" } } Are there any way to add a script tag to set the new field timestamp from the old _timestamp ? 回答1: I'm

How to sort data by _version in ElasticSearch

情到浓时终转凉″ 提交于 2019-12-13 02:02:09
问题 As I am able to sort data using score like { "version":true, "_source":false, "sort": [ { "_score": { "order": "desc" } } ], "query": { "match_all": {} } } Please let me know How can I do the same with _version. By default Fielddata is not supported on field _version. So may be I am missing some thing. Is there any specific setting to query with version? Please help! 回答1: You can't do this, and usually you don't have to. See this thread: https://discuss.elastic.co/t/filter-by--version-and

elastic search 5.1.1 unable to install elasticsearch-head?

随声附和 提交于 2019-12-12 04:36:20
问题 I've just install latest elasticseach on my mac using brew install elasticsearch , and it can run and I can see contents from localhost:9200 . But I tried to install web-browser for it. So the stack over flow says there's a "plugin" command under elasticsearch/bin folder. But seems this is an answer for very old version of Elasticsearch. Now there's only one /usr/local/Cellar/elasticsearch/5.1.1/libexec/bin/elasticsearch-plugin , and I failed to: elasticsearch-plugin install mobz

How can I apply a threshold for a bar graph in Kibana?

我只是一个虾纸丫 提交于 2019-12-12 00:37:51
问题 I've gone through this particular ticket, which pretty much talks about adding a threshold line, to a line graph . In my case, I'm having a bar graph like this where I need to have a threshold, lets say for example in the above graph itself I should be able to show the difference in each and every bar. In other words as per the above graph, it's displaying the sum of chargeamount according to the filter I've given. What I need to do is, to show the difference using a color in the same bar