Permalink
Browse files

Merge pull request #48 from ljo/develop

Handle UnsupportedOperationException for certain lucene field queries to avoid resource drainage
  • Loading branch information...
dizzzz committed Sep 19, 2013
2 parents 8be8f34 + fc20e5e commit 63e0d6e5efd0eae4afc7e0408f898367cc9b4ba9
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2008-2012 The eXist-db Project
+ * Copyright (C) 2008-2013 The eXist-db Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -326,6 +326,8 @@ private void getTerms() {
LuceneUtil.extractTerms(query, termMap, reader, false);
} catch (IOException e) {
LOG.warn("Error while highlighting lucene query matches: " + e.getMessage(), e);
+ } catch (UnsupportedOperationException uoe) {
+ LOG.warn("Error while highlighting lucene query matches: " + uoe.getMessage(), uoe);
} finally {
index.releaseReader(reader);
}
@@ -105,8 +105,9 @@ public static QName decodeQName(String s, SymbolTable symbols) {
* @param query
* @param terms
* @throws IOException in case of an error
+ * @throws UnsupportedOperationException in case of an error
*/
- public static void extractTerms(Query query, Map<Object, Query> terms, IndexReader reader, boolean includeFields) throws IOException {
+ public static void extractTerms(Query query, Map<Object, Query> terms, IndexReader reader, boolean includeFields) throws IOException, UnsupportedOperationException {
if (query instanceof BooleanQuery)
extractTermsFromBoolean((BooleanQuery)query, terms, reader, includeFields);
else if (query instanceof TermQuery)

0 comments on commit 63e0d6e

Please sign in to comment.