
SQL Query Limits and the Document Library
<< TableOfContents>>
Introduction #
In order for searches in the Document Library to work, the SQL clause count must equal AT LEAST as many folders as you have in your Document Library.
Background #
If you don't ensure this is true, then you may find that documents can be found with a search that is conducted from within a lower-level folder in the Document Library, but the same search will fail to find those same documents, when it is conducted from a higher folder level.
This is because each folder is added to your SQL query. Therefore, if a search is made from within lower levels in the Document Library's folder hierarchy, the search may succeed because the numbers of folders at that level and below was less than the maximum clause count. But if the same search is performed from higher levels in the Document Library, then the search may fail because there are more folders to be searched through, from that higher level -- there are more folders beneath it, after all.
If you have search problems of this sort, modify the Lucene BooleanQueryImpl() method to reset the maximum clause count to a higher number -- the clause count should be at least as high as the number of folders found in the Document Library:
public class BooleanQueryImpl implements Boolean Query { public BooleanQueryImpl() { _booleanQuery = new org.apache.lucene.search.BooleanQuery(); _booleanQuery.setMaxClauseCount(8000); } <...> }