use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.
the class ParentChildrenTest method testFilterOnlyWithParentValues.
@Test
public void testFilterOnlyWithParentValues() {
FulltextSearch search = Search.fulltext().setStrict(false).filter(and(not(eq(parent_value, "orange")), or(eq(parent_value, "blue"), eq(parent_value, "red")))).orChildrenSearch(child);
SearchResult result = server.execute(search, parent);
assertEquals(3, result.getNumOfResults());
assertEquals(Integer.valueOf(2), result.getResults().get(1).getChildCount());
}
use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.
the class ParentChildrenTest method testFilterRandomOrderFailure.
// MBDN-599
@Test
public void testFilterRandomOrderFailure() {
FulltextSearch search = Search.fulltext().setStrict(false).filter(and(eq(child_value, "blue"), eq(shared_value, "red"))).orChildrenSearch(child);
SearchResult result = server.execute(search, parent);
assertEquals(2, result.getNumOfResults());
// 0 because none of the assets have the shared_value:red
assertEquals(Integer.valueOf(0), result.getResults().get(0).getChildCount());
}
use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.
the class ParentChildrenTest method testQuerySyntaxExceptionOnChildrenFacetSearch.
@Test
public void testQuerySyntaxExceptionOnChildrenFacetSearch() {
FulltextSearch search = Search.fulltext("S003 \"M001\" M004").setStrict(false).orChildrenSearch(child);
SearchResult result = server.execute(search, parent);
assertEquals(3, result.getNumOfResults());
search = Search.fulltext("S003 AND").setStrict(false).orChildrenSearch(child);
result = server.execute(search, parent);
assertEquals(1, result.getNumOfResults());
search = Search.fulltext("S003 \"").setStrict(false).orChildrenSearch(child);
result = server.execute(search, parent);
assertEquals(1, result.getNumOfResults());
search = Search.fulltext("S003 (").setStrict(false).orChildrenSearch(child);
result = server.execute(search, parent);
assertEquals(1, result.getNumOfResults());
}
use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.
the class ParentChildrenTest method testSubdocumentFacetCountsFailure.
// MBDN-599
@Test
public void testSubdocumentFacetCountsFailure() {
FulltextSearch search = Search.fulltext().setStrict(false).filter(eq(shared_value, "red")).orChildrenSearch(child);
SearchResult result = server.execute(search, parent);
assertEquals(1, result.getFacetResults().getSubdocumentFacets().stream().findFirst().get().getChildrenCount());
assertEquals(1, (long) result.getFacetResults().getSubdocumentFacets().stream().findFirst().get().getParentCount());
search = Search.fulltext().setStrict(false).filter(or(eq(shared_value, "yellow"), eq(child_value, "red"))).orChildrenSearch(child);
result = server.execute(search, parent);
assertEquals(2, result.getFacetResults().getSubdocumentFacets().stream().findFirst().get().getChildrenCount());
assertEquals(1, (long) result.getFacetResults().getSubdocumentFacets().stream().findFirst().get().getParentCount());
}
use of com.rbmhtechnology.vind.api.result.SearchResult in project vind by RBMHTechnology.
the class ParentChildrenTest method testFilterOnlyWithParentValue.
@Test
public void testFilterOnlyWithParentValue() {
FulltextSearch search = Search.fulltext().setStrict(false).filter(eq(parent_value, "blue")).orChildrenSearch(child);
SearchResult result = server.execute(search, parent);
assertEquals(1, result.getNumOfResults());
assertEquals(Integer.valueOf(2), result.getResults().get(0).getChildCount());
}
Aggregations