}
@Test
public void testComplexQuery() {
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_TIMESTAMP,
Operators.OPERATOR_AFTER, new Date(1248183795312L)));
ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_TIMESTAMP,
Operators.OPERATOR_BEFORE, new Date(1248183796234L)));
ops.add(getRestrictionFactory().newRestriction(Log4JFieldProvider.FIELD_MESSAGE,
Operators.OPERATOR_CONTAINS, "manager"));
ResultPage p = indexService.query(ctx, ops, 0, 1000);
assertEquals(2, p.getItems().size());
assertEquals(2, p.getTotalHits());
} finally {
ctx.close();
}