How to search for a part of a word with ElasticSearch

I’m using nGram, too. I use standard tokenizer and nGram just as a filter. Here is my setup: { “index”: { “index”: “my_idx”, “type”: “my_type”, “analysis”: { “index_analyzer”: { “my_index_analyzer”: { “type”: “custom”, “tokenizer”: “standard”, “filter”: [ “lowercase”, “mynGram” ] } }, “search_analyzer”: { “my_search_analyzer”: { “type”: “custom”, “tokenizer”: “standard”, “filter”: [ “standard”, “lowercase”, “mynGram” … Read more

Content-Type header [application/x-www-form-urlencoded] is not supported on Elasticsearch

To fix this, add curl option -H ‘Content-Type: application/json’ This error is due to strict content-type checking introduced in ElasticSearch 6.0, as explained in this post Starting from Elasticsearch 6.0, all REST requests that include a body must also provide the correct content-type for that body.

ElasticSearch: Unassigned Shards, how to fix?

By default, Elasticsearch will re-assign shards to nodes dynamically. However, if you’ve disabled shard allocation (perhaps you did a rolling restart and forgot to re-enable it), you can re-enable shard allocation. # v0.90.x and earlier curl -XPUT ‘localhost:9200/_settings’ -d ‘{ “index.routing.allocation.disable_allocation”: false }’ # v1.0+ curl -XPUT ‘localhost:9200/_cluster/settings’ -d ‘{ “transient” : { “cluster.routing.allocation.enable” : … Read more

Delete all documents from index/type without deleting type

I believe if you combine the delete by query with a match all it should do what you are looking for, something like this (using your example): curl -XDELETE ‘http://localhost:9200/twitter/tweet/_query’ -d ‘{ “query” : { “match_all” : {} } }’ Or you could just delete the type: curl -XDELETE http://localhost:9200/twitter/tweet Note: XDELETE is deprecated for … Read more

Elasticsearch: Max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

Vivek’s answer sysctl -w vm.max_map_count=262144 is correct, however, the setting will only last for the duration of the session. If the host reboots, the setting will be reset to the original value. If you want to set this permanently, you need to edit /etc/sysctl.conf and set vm.max_map_count to 262144. When the host reboots, you can … Read more

Show all Elasticsearch aggregation results/buckets and not just 10

The size param should be a param for the terms query example: curl -XPOST “http://localhost:9200/imoveis/_search?pretty=1” -d’ { “size”: 0, “aggregations”: { “bairro_count”: { “terms”: { “field”: “bairro.raw”, “size”: 10000 } } } }’ Use size: 0 for ES version 2 and prior. Setting size:0 is deprecated in 2.x onwards, due to memory issues inflicted on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)