private void search0(SearchResult result, IndexReader indexReader, String queryText, int offset, int limit) throws ParseException, IOException { if (ZimbraLog.rmgmt.isDebugEnabled()) ZimbraLog.rmgmt.debug("searching query=" + queryText + " offset=" + offset + " limit=" + limit + " " + this);
private void search0(SearchResult result, IndexReader indexReader, Query query, int offset, int limit) throws ParseException, IOException { if (ZimbraLog.rmgmt.isDebugEnabled()) ZimbraLog.rmgmt.debug("searching query=" + query + " offset=" + offset + " limit=" + limit + " " + this);
    private void search0(SearchResult result, IndexReader indexReader, String queryText, int offset, int limit) throws ParseException, IOException {        if (ZimbraLog.rmgmt.isDebugEnabled()) ZimbraLog.rmgmt.debug("searching query=" + queryText + " offset=" + offset + " limit=" + limit + " " + this);        Searcher searcher = null;        try {            searcher = new IndexSearcher(indexReader);            Analyzer analyzer = new StandardAnalyzer();            Query query = QueryParser.parse(queryText, "id", analyzer);            Hits hits = searcher.search(query);                        if (offset < hits.length()) {                int n;                if (limit <= 0) {                    n = hits.length();                } else {                    n = Math.min(offset + limit, hits.length());                }                                for (int i = offset; i < n; i++) {                    Document doc = hits.doc(i);                    Map<QueueAttr,String> qitem = docToQueueItem(doc);                    result.qitems.add(qitem);                }            }        } finally {            if (searcher != null) {                searcher.close();            }        }    }