terms.put("q", "!");
Searcher searcher = mock(Searcher.class);
when(searcher.canHandle(Mockito.any(Map.class))).thenReturn(true);
when(
searcher.flatIteratorSearch(Mockito.any(Map.class), anyString(), anyInt(), anyInt(), anyInt(),
anyBoolean(), Mockito.any(SearchType.class), Mockito.any(List.class)))
// emulate current indexer search behavior, illegal query results in IllegalArgEx with the ParseEx as cause
.thenThrow(new IllegalArgumentException(new ParseException("mock")));
try {