Search in sources :

Example 6 with JLHScore

use of org.elasticsearch.search.aggregations.bucket.significant.heuristics.JLHScore in project elasticsearch by elastic.

the class SignificantTermsIT method testDefaultSignificanceHeuristic.

public void testDefaultSignificanceHeuristic() 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 JLHScore()).minDocCount(2)).execute().actionGet();
    assertSearchResponse(response);
    SignificantTerms topTerms = response.getAggregations().get("mySignificantTerms");
    checkExpectedStringTermsFound(topTerms);
}
Also used : JLHScore(org.elasticsearch.search.aggregations.bucket.significant.heuristics.JLHScore) SignificantTerms(org.elasticsearch.search.aggregations.bucket.significant.SignificantTerms) TermQueryBuilder(org.elasticsearch.index.query.TermQueryBuilder) SearchResponse(org.elasticsearch.action.search.SearchResponse) ElasticsearchAssertions.assertSearchResponse(org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse)

Aggregations

JLHScore (org.elasticsearch.search.aggregations.bucket.significant.heuristics.JLHScore)6 ChiSquare (org.elasticsearch.search.aggregations.bucket.significant.heuristics.ChiSquare)5 GND (org.elasticsearch.search.aggregations.bucket.significant.heuristics.GND)5 MutualInformation (org.elasticsearch.search.aggregations.bucket.significant.heuristics.MutualInformation)5 PercentageScore (org.elasticsearch.search.aggregations.bucket.significant.heuristics.PercentageScore)3 SignificanceHeuristic (org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristic)2 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1 BytesRef (org.apache.lucene.util.BytesRef)1 RegExp (org.apache.lucene.util.automaton.RegExp)1 SearchResponse (org.elasticsearch.action.search.SearchResponse)1 TermQueryBuilder (org.elasticsearch.index.query.TermQueryBuilder)1 Script (org.elasticsearch.script.Script)1 SearchModule (org.elasticsearch.search.SearchModule)1 SignificantTerms (org.elasticsearch.search.aggregations.bucket.significant.SignificantTerms)1 SignificantTermsAggregationBuilder (org.elasticsearch.search.aggregations.bucket.significant.SignificantTermsAggregationBuilder)1 ScriptHeuristic (org.elasticsearch.search.aggregations.bucket.significant.heuristics.ScriptHeuristic)1 SignificanceHeuristicParser (org.elasticsearch.search.aggregations.bucket.significant.heuristics.SignificanceHeuristicParser)1 IncludeExclude (org.elasticsearch.search.aggregations.bucket.terms.support.IncludeExclude)1 ElasticsearchAssertions.assertSearchResponse (org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse)1