(relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch version : 2.3.0
Opensearch Dashboard version : 2.3.0
Broswer : Chrome ( Tested with Mozilla, Brave, safari )
Describe the issue:
Searching was working good with out any issues but 2 days earlier it started to throw below exception
Bad Request
null_pointer_exception
Cannot invoke "org.opensearch.search.aggregations.InternalAggregations.getSerializedSize()" because "reducePhase.aggregations" is null
Its not the disk space issue and I have enough or more free space.
This is the error I am getting in Dev Tool
{
“error” : {
“root_cause” : [
{
“type” : “query_shard_exception”,
“reason” : “failed to create query: field expansion matches too many fields, limit: 1024, got: 1276”,
“type” : “search_phase_execution_exception”,
“reason” : “”,
"caused_by" : {
"type" : "null_pointer_exception",
"reason" : "Cannot invoke \"org.opensearch.search.aggregations.InternalAggregations.getSerializedSize()\" because \"reducePhase.aggregations\" is null"
}
I solved the issue for me. the solution was to update the following setting on the indices in question:
PUT /index_pattern-*/_settings
{
"index.max_docvalue_fields_search" : "200"
}
I figured this out by running the request as a curl, which gave me a useful error, that gave me the solution. I did this by going to to chrome dev tools, going to the discover page in opensearch, and selecting the offending index pattern. If you go to the network tab, you can see the request that’s used for the discover query. right click, and copy as curl. Run that in a terminal, and you might get a more helpful error.
@raj1209 According to OpenSearch documentation indices.query.bool.max_clause_count: has value 4096 assigned by default.
Searching all eligible fields could be a resource-intensive operation. The indices.query.bool.max_clause_count search setting defines the maximum value for the product of the number of fields and the number of terms that can be queried at one time. The default value for indices.query.bool.max_clause_count is 4,096.
However, in the code SearchModule.java the default is set to 1024
As per documentation, increasing the max value of that setting would impact the search performance.
So is it advised to search with field name instead of searching only value or messages
This does not happens in all the index though, I’m currently facing with one index now.
This is how it concludes or is there anything you advise on this.