use of com.yahoo.prelude.query.SubstringItem in project vespa by vespa-engine.
the class QueryRewrite method rewriteSddocname.
private static Item rewriteSddocname(Item item) {
if (item instanceof CompositeItem) {
CompositeItem parent = (CompositeItem) item;
for (int i = 0, len = parent.getItemCount(); i < len; ++i) {
Item oldChild = parent.getItem(i);
Item newChild = rewriteSddocname(oldChild);
if (oldChild != newChild) {
parent.setItem(i, newChild);
}
}
} else if (item instanceof SimpleIndexedItem) {
SimpleIndexedItem oldItem = (SimpleIndexedItem) item;
if (Hit.SDDOCNAME_FIELD.equals(oldItem.getIndexName())) {
SubstringItem newItem = new SubstringItem(oldItem.getIndexedString());
newItem.setIndexName("[documentmetastore]");
return newItem;
}
}
return item;
}
use of com.yahoo.prelude.query.SubstringItem in project vespa by vespa-engine.
the class ParseTestCase method testSubstringExtraSpace.
@Test
public void testSubstringExtraSpace() {
Item root = tester.assertParsed("*substring*", "* substring*", Query.Type.ANY);
assertTrue(root instanceof SubstringItem);
}
use of com.yahoo.prelude.query.SubstringItem in project vespa by vespa-engine.
the class ParseTestCase method testSubstringWithWeight.
@Test
public void testSubstringWithWeight() {
Item root = tester.assertParsed("*substring*!200", "*substring*!200", Query.Type.ANY);
assertTrue(root instanceof SubstringItem);
}
use of com.yahoo.prelude.query.SubstringItem in project vespa by vespa-engine.
the class ParseTestCase method testSingleSubstringTerm.
@Test
public void testSingleSubstringTerm() {
Item root = tester.assertParsed("*substring*", "*substring*", Query.Type.ANY);
assertTrue(root instanceof SubstringItem);
}
use of com.yahoo.prelude.query.SubstringItem in project vespa by vespa-engine.
the class ParseTestCase method testSubstringExtraStar.
@Test
public void testSubstringExtraStar() {
Item root = tester.assertParsed("*substring*", "**substring**", Query.Type.ANY);
assertTrue(root instanceof SubstringItem);
}
Aggregations