« 返回到 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 附件
26143 查看
平均 (0 票)
满分为 5,平均得分为 0.0。
评论
讨论主题回复 作者 日期
In LuceneIndexSearcherImpl (Liferay 6.0 EE)... Bruce Altner 2011年4月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-4-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
在 12-11-16 上午3:24 发帖以回复 Bruce Altner
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
在 12-11-16 上午3:53 发帖以回复 lou cat