}
@Test
public void testNotContainsQuery() {
try {
IIndexService indexService = IndexPlugin.getDefault().getIndexService();
loadLogFile("sample-1.log.xml");
createLogResourceWithPK("UTF-8", Locale.getDefault(), getTimeZone());
indexService.synchronize(getLogResource(), null);
IQueryContext ctx = indexService.createQueryContext(getLogResource());
try {
List<ARestriction<?>> ops = new LinkedList<ARestriction<?>>();
ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
Operators.OPERATOR_NOT_CONTAINS, "recovery"));
ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
Operators.OPERATOR_NOT_CONTAINS, "starting"));
ResultPage p = indexService.query(ctx, ops, 0, 1000);
assertEquals(3, p.getItems().size());
assertEquals(3, p.getTotalHits());
} finally {
ctx.close();
}