/* Wait for Indexer */
waitForIndexer();
{
ISearchField field = fFactory.createSearchField(INews.TITLE, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"lives hungry\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(INews.TITLE, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"Johnny lives hungry Depp\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(INews.DESCRIPTION, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"longer name like\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news1, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"lives hungry\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"Johnny lives hungry Depp\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"longer name like\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news1, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition1 = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"longer name like\"");
ISearchCondition condition2 = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"Johnny lives hungry Depp\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition1, condition2), false);
assertSame(result, news1, news2, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition1 = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"longer name like\"");
ISearchCondition condition2 = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"Johnny lives hungry Depp\"");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition1, condition2), true);
assertSame(result, news3, news4, news5);
}
{
ISearchField field = fFactory.createSearchField(INews.TITLE, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"lives hungry\" lives hungry");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3);
}
{
ISearchField field = fFactory.createSearchField(IEntity.ALL_FIELDS, fNewsEntityName);
ISearchCondition condition = fFactory.createSearchCondition(field, SearchSpecifier.CONTAINS_NOT, "\"lives hungry\" lives hungry");
List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
assertSame(result, news2, news3);
}
} catch (PersistenceException e) {