use of com.yahoo.searchdefinition.Search in project vespa by vespa-engine.
the class NGramTestCase method testInvalidNGramSetting1.
@Test
public void testInvalidNGramSetting1() throws IOException, ParseException {
try {
Search search = SearchBuilder.buildFromFile("src/test/examples/invalidngram1.sd");
fail("Should cause an exception");
} catch (IllegalArgumentException e) {
assertEquals("gram-size can only be set when the matching mode is 'gram'", e.getMessage());
}
}
use of com.yahoo.searchdefinition.Search in project vespa by vespa-engine.
the class NGramTestCase method testInvalidNGramSetting2.
@Test
public void testInvalidNGramSetting2() throws IOException, ParseException {
try {
Search search = SearchBuilder.buildFromFile("src/test/examples/invalidngram2.sd");
fail("Should cause an exception");
} catch (IllegalArgumentException e) {
assertEquals("gram-size can only be set when the matching mode is 'gram'", e.getMessage());
}
}
use of com.yahoo.searchdefinition.Search in project vespa by vespa-engine.
the class WeightedSetSummaryToTestCase method testRequireThatImplicitFieldsAreCreated.
@Test
public void testRequireThatImplicitFieldsAreCreated() throws IOException, ParseException {
Search search = SearchBuilder.buildFromFile("src/test/examples/weightedset-summaryto.sd");
assertNotNull(search);
}
use of com.yahoo.searchdefinition.Search in project vespa by vespa-engine.
the class IndexingScriptRewriterTestCase method processField.
private static ScriptExpression processField(SDField unprocessedField) {
SDDocumentType sdoc = new SDDocumentType("test");
sdoc.addField(unprocessedField);
Search search = new Search("test", null);
search.addDocument(sdoc);
Processing.process(search, new BaseDeployLogger(), new RankProfileRegistry(), new QueryProfiles(), true);
return unprocessedField.getIndexingScript();
}
use of com.yahoo.searchdefinition.Search in project vespa by vespa-engine.
the class PositionTestCase method requireThatExtraFieldCanBePositionAttribute.
@Test
public void requireThatExtraFieldCanBePositionAttribute() throws Exception {
Search search = SearchBuilder.buildFromFile("src/test/examples/position_extra.sd");
assertNull(search.getAttribute("pos_ext"));
assertNull(search.getAttribute("pos_ext.x"));
assertNull(search.getAttribute("pos_ext.y"));
assertPositionAttribute(search, "pos_ext", Attribute.CollectionType.SINGLE);
assertPositionSummary(search, "pos_ext", false);
}
Aggregations