Solr Queries That Fail on Their Own

Account Resources

Some queries fail because of what they are, not because of the server they run on. These are the shapes to recognise.

Some requests do not degrade — they throw. These are the ones we see most often in the error logs of indexes that were working fine the day before.

What arrivesWhat happensWhat to do instead
A filter query built from thousands of idsToo many boolean clauses. The Solr default is 1,024; how the limit works and when it can be raised: Too Many Boolean Clauses.Use a terms query parser, a join, or a field the documents already share. See Too many boolean clauses.
A leading wildcard on a large fieldEvery term in the field dictionary is enumerated before anything is scored.Index a reversed or n-gram copy of the field, or anchor the wildcard at the end.
A sort on an analyzed text fieldEither an error, or a sort on the wrong thing — the first token rather than the value.Sort on a string copy with docValues, or on solr.SortableTextField.
A document with one enormous field valueImmense term, indexing rejected for that document.Truncate or split before indexing. See Document contains immense term.
A commit after every single documentA new searcher per document, cache warming per document, merge pressure and a growing pile of open readers.Batch your updates and let autoSoftCommit handle visibility. One commit per batch, never per document.

Solr best practices

Queries that fail on their own (this page)