« Document Library... に戻る

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); } <...> }

0 添付ファイル
26141 参照数
平均 (0 投票)
平均評価は0.0星中の5です。
コメント
コメント 作成者 日時
In LuceneIndexSearcherImpl (Liferay 6.0 EE)... Bruce Altner 2011/04/29 10:13
I'm using Liferay 6.0.6 CE and I believe to... lou cat 2012/11/16 3:24
Note: it seems my version is catching the... lou cat 2012/11/16 3:53

In LuceneIndexSearcherImpl (Liferay 6.0 EE) this is handled by catching the BooleanQuery.TooManyClauses exception, then setting the limit to Integer.MAX_VALUE and rerunning the query. So this is probably OBE?
投稿日時:11/04/29 10:13
I'm using Liferay 6.0.6 CE and I believe to have this problem (when I try to select a root folder from the configuration of DL display, I'm not able to see more than the first 20 folders).

Please can you explain better what is the best practice to modify that class? It seems part of liferay kernel and I'd like not to mess up everything emoticon

I've also created a thread in the forum, if you prefer that:
http://www.liferay.com/community/forums/-/message_boards/message/17956366
Bruce Altnerへのコメント。投稿日時:12/11/16 3:24
Note: it seems my version is catching the BooleanQuery.TooManyClauses exception... so or this is not related to my problem, or the exception doesn't solve the issue emoticon
lou catへのコメント。投稿日時:12/11/16 3:53