spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » ELASTICSEARCH » Page 1
Paging in Elasticsearch when results have equal scores
I ended up using additional sort in cases where equal scores are likely to happen - for example searching by product category. This additional sort could be id, creation date or similar. The setup is 2 servers, 3 shards and 1 replica.

Categories : Elasticsearch

Kibana: To get all _types by using _index
This is disabled by default. You can enable it by adding "_index" : { "enabled" : true } to your mapping. Source: Issue on github

Categories : Elasticsearch

Configuration ELK + log4j
I know it's an old post, but someone may find it useful - log4j SocketAppender can't use layout, see docs for SocketAppender SocketAppenders do not use a layout. They ship a serialized LoggingEvent object to the server side. You also don't need additional filter in logstash configuration. Logstash log4j plugin minimal configuration is sufficient input { log4j { data_timeout =>

Categories : Elasticsearch

Elastic search get query not taking updated information
you can use the Refresh parameter as described here : http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html This will make sure the updated document will be available immediately within a search result. Hope this helps !

Categories : Elasticsearch

Applying multiple filters, aggregated into a single metric with elasticsearch
Yes there is. You need to use filter aggregation instead of filters aggregation. Query would be something like below: { "aggregations": { "prices": { "filter": { "bool": { "must": [ { "terms": { "category.id": [ 870

Categories : Elasticsearch

Elastic exact match w/o changing indexing
Are you sure that you need to do anything? Given your examples, you don't and you probably don't want to do not_analyzed: curl -XPUT localhost:9200/test -d '{ "mappings": { "test" : { "properties": { "body" : { "type" : "string" }, "entities" : { "type" : "object", "properties": { "hashtags" : { "type" : "string"

Categories : Elasticsearch

Treatment of special characters in elasticsearch
That is not how the document is tokenized on my end with that analyzer: curl -XGET localhost:9200/_analyze?tokenizer=keyword&filters=trim,lowercase&pretty -d '1%2fPJJP3JV2C24iDfEu9XpHBaYxXh%2fdHTbmchB35SDznXO2g8Vz4D7GTIvY54iMiX_149c95f02a8' { "tokens" : [ { "token" : "1%2fpjjp3jv2c24idfeu9xphbayxxh%2fdhtbmchb35sdznxo2g8vz4d7gtivy54imix_149c95f02a8", "start_offset" : 0, "end_

Categories : Elasticsearch

Skip common/duplicate parts while indexing web pages with ElasticSearch
It's not terribly difficult to pump web content into Elastic, so I'll assume you have that down. =) I think this article is fantastic for understanding how to index/search web pages: http://blog.urx.com/urx-blog/2014/9/4/the-science-of-crawl-part-1-deduplication-of-web-content It's a complex problem and they have some great detail. There is nothing I know of natively in Elastic that has intelli

Categories : Elasticsearch

NoSuchMethodError when creating mapping for attachment type in ElasticSearch
I had the wrong version of ElasticSearch installed. For the attachment-mapper plugin I had installed, I needed elasticsearch version 1.4. Removed old version, installed new version, installed attachment-mapper plugin, started service, and ran through tutorial again and it worked.

Categories : Elasticsearch

Script with data of sub terms aggregators in Elasticsearch
I think scripted_metric could help. Take a look at my answer for a different this question. In your case, you could count over the two terms and then return term4Cnt / term1Cnt. A rough estimate of what you'd need: "init_script": "_agg.term1Cnt = 0; _agg.term4Cnt = 0;", "map_script": "if (doc.json.eventName == "term1") { _agg.term1Cnt += 1; } else if (doc.jso

Categories : Elasticsearch

Elasticsearch Facets: Search on _index returned no results
this is an example of query with pre filter ( "query" : "*" ) and then a must&mustnot query. then the resutlt is used to make the aggregations : curl -XGET 'http://localhost:9200/YOUR_INDEX_NAME/_search?size=10' -d '{ "query" : { "filtered" : { "query" : { "query_string" : { "query" : "*" } },

Categories : Elasticsearch

Term filter causes memory to spike drastically
It's quite an old version of Elasticsearch You're returning 50,000 records in one get Sorting the 50k records Your documents are pretty big - 350 fields. Could you instead return a smaller number of records? and then page through them? Scan and Scroll could help you. it's not clear whether you've indexed individual fields - this could help as the _source being read from disk may be incurring a

Categories : Elasticsearch

Kibana returns “Connection Failed” - Unsolved Error
This might be caused because of two issues. Please check you are using compatible versions of Elasticsearch and Kibana. Recommended to use latest versions of both. elasticsearch-1.4.4 and kibana-4.0.0-rc1-windows worked for me. This is little interesting. If you are using logstash and if one of your job is still running then Kibana gives error in that case. You can refer to these articles for

Categories : Elasticsearch

elasticsarch synonym filter with English analyzer
This is because synonym/filter is not an applicable parameter to configure for "english" analyzer. There is a difference between a custom analyzer and a builtin analyzer. Builtin analyzers only allow certain parameters to be configurable . i.e in case of language analyzers it is stopwords ,stem exclusion .So the rest of the parameters in my_english alias for english analyzers are just ignored .Pr

Categories : Elasticsearch

Elasticsearch Search in nested array
You can use a simple match query if you're just looking for records with an activity type like { "query": { "match": { "activity.type": "Outdoor" } } }

Categories : Elasticsearch

Elastic search aggregation sum of decimal values
You mention that the price is of type long. When providing 0.5 to a long it's rounds the number, it does not do this mathematically. So the actual value stored is not 0.5 but 0. Make it a double.

Categories : Elasticsearch

Elasticsearch aggregation on parent properties
That should be easy and I feel your question refers to something else: GET /my_index/post/_search # query the POSTs type { "query": { "has_child": { "type": "comment", # this is the COMMENT "query": { "match": { "data": "whatever" # query the content of the COMMENT } } } }, "aggs": { "categories_agg": { "terms": {

Categories : Elasticsearch

Using unrecommended ElasticSearch version (latest) with Logstash (latest)
Following the documented rolling upgrade process, I went ahead and upgraded my ES nodes to 1.4 with no problems. Setting the logstash elasticsearch output protocol to http did cause my logstash server to drop out as a member of the ES cluster, but this doesn't seem to have any consequences.

Categories : Elasticsearch

strange {"OK":{}} response on ElasticSearch curl -X GET 'http://localhost:9200'
Elasticsearch 1.3.2 alone is not capable of producing such response - there is simply no "OK" string in the production source code. So, I would guess somebody installed a plugin on this node that intercepts some calls and replaces them with this message. One of the plugins that does that is elasticsearch-http-basic plugin, which indeed displays {"OK":{}} to unauthorized users instead of a full r

Categories : Elasticsearch

Elasticsearch and Spanish Accents
To prevent the extra tokens being formed, you need to use an alternative tokenizer, e.g. try the whitespace tokenizer. Alternatively use a language analyzer and specify the language.

Categories : Elasticsearch


Recently Add
ElasticSearch Can't open file to read checksums
Paging in Elasticsearch when results have equal scores
Kibana: To get all _types by using _index
Configuration ELK + log4j
Elastic search get query not taking updated information
Applying multiple filters, aggregated into a single metric with elasticsearch
Elastic exact match w/o changing indexing
Treatment of special characters in elasticsearch
Skip common/duplicate parts while indexing web pages with ElasticSearch
NoSuchMethodError when creating mapping for attachment type in ElasticSearch
Script with data of sub terms aggregators in Elasticsearch
Elasticsearch Facets: Search on _index returned no results
Term filter causes memory to spike drastically
Kibana returns “Connection Failed” - Unsolved Error
elasticsarch synonym filter with English analyzer
Elasticsearch Search in nested array
Elastic search aggregation sum of decimal values
Elasticsearch aggregation on parent properties
Using unrecommended ElasticSearch version (latest) with Logstash (latest)
strange {"OK":{}} response on ElasticSearch curl -X GET 'http://localhost:9200'
Elasticsearch and Spanish Accents
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.