Search in sources :

Example 1 with TermsSetQueryScript

use of org.opensearch.script.TermsSetQueryScript in project OpenSearch by opensearch-project.

the class ExpressionTermsSetQueryTests method testFieldAccessWithFieldAlias.

public void testFieldAccessWithFieldAlias() throws IOException {
    TermsSetQueryScript script = compile("doc['alias'].value").newInstance(null);
    script.setDocument(1);
    double result = script.execute().doubleValue();
    assertEquals(2.718, result, 0.0);
}
Also used : TermsSetQueryScript(org.opensearch.script.TermsSetQueryScript)

Example 2 with TermsSetQueryScript

use of org.opensearch.script.TermsSetQueryScript in project OpenSearch by opensearch-project.

the class ExpressionTermsSetQueryTests method testFieldAccess.

public void testFieldAccess() throws IOException {
    TermsSetQueryScript script = compile("doc['field'].value").newInstance(null);
    script.setDocument(1);
    double result = script.execute().doubleValue();
    assertEquals(2.718, result, 0.0);
}
Also used : TermsSetQueryScript(org.opensearch.script.TermsSetQueryScript)

Aggregations

TermsSetQueryScript (org.opensearch.script.TermsSetQueryScript)2