Skip to content

Commit

Permalink
Search: Empty facets element causes search failures, closes elastic#938.
Browse files Browse the repository at this point in the history
  • Loading branch information
kimchy committed May 17, 2011
1 parent ee18228 commit c787f31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Expand Up @@ -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) {
Expand Down
Expand Up @@ -78,6 +78,9 @@ public void addCollector(String scope, Collector collector) {
}

public List<Collector> removeCollectors(String scope) {
if (scopeCollectors == null) {
return null;
}
return scopeCollectors.remove(scope);
}

Expand Down

0 comments on commit c787f31

Please sign in to comment.