public void testOptimizeFullOptimizationComplex() throws Exception {
final OSQLFilter filter = OSQLEngine.getInstance().parseCondition("a = 3 and b = 4", null, "WHERE");
final OSQLFilterCondition condition = filter.getRootCondition();
final OIndexSearchResult searchResult;
{
final OIndexSearchResult searchResult1;
{
final OSQLFilterCondition cnd = (OSQLFilterCondition) condition.getLeft();
searchResult1 = new OIndexSearchResult(cnd.getOperator(), ((OSQLFilterItemField) cnd.getLeft()).getFieldChain(), 3);
}
final OIndexSearchResult searchResult2;
{
final OSQLFilterCondition cnd = (OSQLFilterCondition) condition.getRight();
searchResult2 = new OIndexSearchResult(cnd.getOperator(), ((OSQLFilterItemField) cnd.getLeft()).getFieldChain(), 4);
}
searchResult = searchResult1.merge(searchResult2);
}
optimizer.optimize(filter, searchResult);