lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Jakarta Lucene Wiki] Updated: LuceneFAQ
Date Mon, 03 Jan 2005 21:14:36 GMT
   Date: 2005-01-03T13:14:36
   Editor: DanielNaber
   Wiki: Jakarta Lucene Wiki
   Page: LuceneFAQ

   new item about toomanyclauses exception

Change Log:

@@ -89,6 +89,26 @@
  * Use the Query's toString() method to see how it actually got parsed.
  * Use [ Luke] to browse your index.
+==== Why am I getting a TooManyClauses exception? ====
+The following types of queries are expanded by Lucene before it does the search: !RangeQuery,
+!PrefixQuery, !WildcardQuery, !FuzzyQuery. For example, if the indexed document contain the
terms "car"
+and "cars" the query "ca*" will be expanded to "car OR cars" before the search takes place.
+number of these terms is limited to 1000 be default. Here's what you can do to avoid the
+!TooManyClauses exception:
+ * Use a filter that restricts the query. For example, a !DateFilter can replace a !RangeQuery
on date
+ fields and it will never throw the !TooManyClauses exception. Note that filters are slower
+ queries when used for the first time, so you chould cache them using
+ [
+ * If the problem occurs with !RangeQuery, try to reduce the number of terms in the index.
+ example, the !DateField class uses a microsecond resultion, which is often not required.
Instead you
+ can save your dates in the "yyyymmddHHMM" format, maybe even without hours and minutes if
you don't
+ need them (this will be simplified in Lucene 2.0 thanks to the new !DateTools class).
+ * Increase the number of terms using [
BooleanQuery.setMaxClauseCount()]. Note that this will increase the memory requirements for
searches that expand to many terms. To deactivate any limits, use !BooleanQuery.setMaxClauseCount(Integer.MAX_VALUE).
 ==== What wildcard search support is available from Lucene? ====
 Lucene supports wild card queries which allow you to perform searches such as ''book*'',
which will find documents containing terms such as ''book'', ''bookstore'', ''booklet'', etc.
Lucene refers to this type of a query as a 'prefix query'.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message