Example usage for org.apache.lucene.document FeatureField newSaturationQuery

List of usage examples for org.apache.lucene.document FeatureField newSaturationQuery

Introduction

In this page you can find the example usage for org.apache.lucene.document FeatureField newSaturationQuery.

Prototype

public static Query newSaturationQuery(String fieldName, String featureName) 

Source Link

Document

Same as #newSaturationQuery(String,String,float,float) but 1f is used as a weight and a reasonably good default pivot value is computed based on index statistics and is approximately equal to the geometric mean of all values that exist in the index.

Usage

From source file:org.elasticsearch.index.query.FeatureQueryBuilderTests.java

License:Apache License

public void testDefaultScoreFunction() throws IOException {
    String query = "{\n" + "    \"feature\" : {\n" + "        \"field\": \"my_feature_field\"\n" + "    }\n"
            + "}";
    Query parsedQuery = parseQuery(query).toQuery(createShardContext());
    assertEquals(FeatureField.newSaturationQuery("_feature", "my_feature_field"), parsedQuery);
}