Monday, 2 December 2019

Introduction on Elastic search

Introduction on Elastic search

This PPT will give basic understanding about elastic search.

  • What is Elastic search
  • When to use Elastic search
  • Where we can use Elastic search
  • Basic concepts of Elastic search
  • Indexing and searching
  • What makes it unique
  • Elastic is adopted worldwide

Elastic search error: QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to

QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [10392]


Error : 

Resolved [Failed to execute phase [dfs], all shards failed; shardFailures {[aMJwZw2XRpKQasjGV3jLOw][logger_stage][0]: 
RemoteTransportException[[aMJwZw2][127.0.0.1:9300][indices:data/read/search[phase/dfs]]]; nested: QueryPhaseExecutionException[Result window is too large, from + size must be less 
than or equal to: [10000] but was [10392]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index 
level setting.]; }{[aMJwZw2XRpKQasjGV3jLOw][logger_stage][1]: RemoteTransportException[[aMJwZw2][127.0.0.1:9300][indices:data/read/search[phase/dfs]]]; 
nested: QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [10392]. See the scroll api for a more efficient way to request 
large data sets. This limit can be set by changing the [index.max_result_window] index level setting.]; }

Solution: Open Kibana and click on Dev Tools. 

Now execute below command:

PUT your_index_name/_settings
{
  "max_result_window" : 500000
}
If all goes well, you will see below response:

{
  "acknowledged": true
}

QueryPhaseExecutionException[Result window is too large, from + size must be less  than or equal to

Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]

Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]


This error occurs when disk space is less than 5% so Elastic search allow only read mode. If you try to write than we will get this error.

Solution:

free up disk space:  Freeing up enough disk space so that more than 5% of the disk is free will solve this problem. Elastic search won't automatically take itself out of read-only mode once enough disk is free though, you'll have to do something like this to unlock the indices:

$ curl -XPUT -H "Content-Type: application/json" https://[YOUR_ELASTICSEARCH_ENDPOINT]:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}'
df -h -- this is use to find disk space.

Elasticsearch error: cluster_block_exception [FORBIDDEN/12/index read-only / allow delete (api)]