use of org.elasticsearch.search.aggregations.bucket.significant.heuristics.ChiSquare in project elasticsearch by elastic.
the class SignificanceHeuristicTests method testAssertions.
public void testAssertions() throws Exception {
testBackgroundAssertions(new MutualInformation(true, true), new MutualInformation(true, false));
testBackgroundAssertions(new ChiSquare(true, true), new ChiSquare(true, false));
testBackgroundAssertions(new GND(true), new GND(false));
testAssertions(new PercentageScore());
testAssertions(new JLHScore());
}
use of org.elasticsearch.search.aggregations.bucket.significant.heuristics.ChiSquare in project elasticsearch by elastic.
the class SignificantTermsIT method testTextAnalysisChiSquare.
public void testTextAnalysisChiSquare() throws Exception {
SearchResponse response = client().prepareSearch("test").setSearchType(SearchType.QUERY_THEN_FETCH).setQuery(new TermQueryBuilder("description", "terje")).setFrom(0).setSize(60).setExplain(true).addAggregation(significantTerms("mySignificantTerms").field("description").executionHint(randomExecutionHint()).significanceHeuristic(new ChiSquare(false, true)).minDocCount(2)).execute().actionGet();
assertSearchResponse(response);
SignificantTerms topTerms = response.getAggregations().get("mySignificantTerms");
checkExpectedStringTermsFound(topTerms);
}
use of org.elasticsearch.search.aggregations.bucket.significant.heuristics.ChiSquare in project elasticsearch by elastic.
the class SignificantTermsSignificanceScoreIT method testBackgroundVsSeparateSet.
public void testBackgroundVsSeparateSet() throws Exception {
String type = randomBoolean() ? "text" : "long";
String settings = "{\"index.number_of_shards\": 1, \"index.number_of_replicas\": 0}";
SharedSignificantTermsTestMethods.index01Docs(type, settings, this);
testBackgroundVsSeparateSet(new MutualInformation(true, true), new MutualInformation(true, false));
testBackgroundVsSeparateSet(new ChiSquare(true, true), new ChiSquare(true, false));
testBackgroundVsSeparateSet(new GND(true), new GND(false));
}
Aggregations