@Test public void call() throws ParseException { ParseQueryTask task = new ParseQueryTask("+foo -bar", analyzer); Query result = task.call(); BooleanQuery query = new BooleanQuery(); query.add(new TermQuery(new Term(PageIndex.ALL_TEXT, "foo")), BooleanClause.Occur.MUST); query.add(new TermQuery(new Term(PageIndex.ALL_TEXT, "bar")), BooleanClause.Occur.MUST_NOT); assertEquals(query, result); }
@Override public Query call() throws ParseException { QueryParser parser = new QueryParser(Version.LUCENE_43, PageIndex.ALL_TEXT, analyzer); parser.setAllowLeadingWildcard(true); return parser.parse(searchText); }
ParseQueryTask implements Callable<Query> { @Override public Query call() throws ParseException { QueryParser parser = new QueryParser(Version.LUCENE_43, PageIndex.ALL_TEXT, analyzer); parser.setAllowLeadingWildcard(true); return parser.parse(searchText); } }
ParseQueryTask implements Callable<Query> { @Override public Query call() throws ParseException { QueryParser parser = new QueryParser(Version.LUCENE_43, PageIndex.ALL_TEXT, analyzer); parser.setAllowLeadingWildcard(true); return parser.parse(searchText); } ParseQueryTask(String searchText, Analyzer analyzer); }
ParseQueryTask implements Callable<Query> { @Override public Query call() throws ParseException { QueryParser parser = new QueryParser(Version.LUCENE_43, PageIndex.ALL_TEXT, analyzer); parser.setAllowLeadingWildcard(true); return parser.parse(searchText); } ParseQueryTask(String searchText, Analyzer analyzer); @Override Query call(); }
ParseQueryTask implements Callable<Query> { @Override public Query call() throws ParseException { QueryParser parser = new QueryParser(Version.LUCENE_43, PageIndex.ALL_TEXT, analyzer); parser.setAllowLeadingWildcard(true); return parser.parse(searchText); } ParseQueryTask(String searchText, Analyzer analyzer); @Override Query call();  }