Search: Empty facets element causes search failures, closes #938.
This commit is contained in:
parent
af222dc75c
commit
cc0a6ed690
|
@ -59,7 +59,7 @@ public class FacetPhase implements SearchPhase {
|
|||
}
|
||||
|
||||
@Override public void execute(SearchContext context) throws ElasticSearchException {
|
||||
if (context.facets() == null) {
|
||||
if (context.facets() == null || context.facets().facetCollectors() == null) {
|
||||
return;
|
||||
}
|
||||
if (context.queryResult().facets() != null) {
|
||||
|
|
|
@ -78,6 +78,9 @@ public class ContextIndexSearcher extends ExtendedIndexSearcher {
|
|||
}
|
||||
|
||||
public List<Collector> removeCollectors(String scope) {
|
||||
if (scopeCollectors == null) {
|
||||
return null;
|
||||
}
|
||||
return scopeCollectors.remove(scope);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue