ElasticSearch: Unassigned Shards, how to fix?

I have an ES cluster with 4 nodes: number_of_replicas: 1 search01 – master: false, data: false search02 – master: true, data: true search03 – master: false, data: true search04 – master: false, data: true I had to restart search03, and when it came back, it rejoined the cluster no problem, but left 7 unassigned shards … Read more

Delete all documents from index/type without deleting type

I know one can delete all documents from a certain type via deleteByQuery. Example: curl -XDELETE ‘http://localhost:9200/twitter/tweet/_query’ -d ‘{ “query” : { “term” : { “user” : “kimchy” } } }’ But i have NO term and simply want to delete all documents from that type, no matter what term. What is best practice to … Read more

elasticsearch v.s. MongoDB for filtering application [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 7 years ago. Improve this question This question is about making an architectural choice prior to delving into the details of experimentation … Read more

Show all Elasticsearch aggregation results/buckets and not just 10

I’m trying to list all buckets on an aggregation, but it seems to be showing only the first 10. My search: curl -XPOST “http://localhost:9200/imoveis/_search?pretty=1” -d’ { “size”: 0, “aggregations”: { “bairro_count”: { “terms”: { “field”: “bairro.raw” } } } }’ Returns: { “took” : 2, “timed_out” : false, “_shards” : { “total” : 5, “successful” … Read more

Beginner’s guide to ElasticSearch [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

elasticsearch bool query combine must with OR

I am currently trying to migrate a solr-based application to elasticsearch. I have this lucene query (( name:(+foo +bar) OR info:(+foo +bar) )) AND state:(1) AND (has_image:(0) OR has_image:(1)^100) As far as I understand this is a combination of MUST clauses combined with boolean OR: “Get all documents containing (foo AND bar in name) OR … Read more

Making a request to a RESTful API using python

I have a RESTful API that I have exposed using an implementation of Elasticsearch on an EC2 instance to index a corpus of content. I can query the search by running the following from my terminal (MacOSX): curl -XGET ‘http://ES_search_demo.com/document/record/_search?pretty=true’ -d ‘{ “query”: { “bool”: { “must”: [ { “text”: { “record.document”: “SOME_JOURNAL” } }, … Read more

Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)], flood stage disk watermark exceeded

When trying to post documents to Elasticsearch as normal I’m getting this error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]; I also see this message on the Elasticsearch logs: flood stage disk watermark [95%] exceeded … all indices on this node will marked read-only 5 Answers 5