Как я могу изменить этот метод в liferay 7?
private static void addVimapFileEntryIdClause(SearchContext searchContext, List<BooleanClause> fieldClauses,long fileEntryIdStart, long fileEntryIdEnd, String vimapFileEntry){
if (fileEntryIdStart != QueryUtil.ALL_POS) {
BooleanQuery fileEntryBooleanQuery = BooleanQueryFactoryUtil.create(
searchContext);
if (fileEntryIdStart == fileEntryIdEnd) {
fileEntryBooleanQuery.addRequiredTerm(
VIMAPConstants.VIMAP_FILE_ENTRY_ID, fileEntryIdStart);
}
else {
fileEntryBooleanQuery.addNumericRangeTerm(
vimapFileEntry, fileEntryIdStart, fileEntryIdEnd);
}
BooleanClause fileEntryFieldClause =
BooleanClauseFactoryUtil.create(searchContext,
fileEntryBooleanQuery,BooleanClauseOccur.MUST.getName());
fieldClauses.add(fileEntryFieldClause);
}
}
я изменяю, как это, но не работает хорошо
private static void addFolderIdClause (SearchContext searchContext, List> fieldClauses, long folderId) {BooleanQuery folderBooleanQuery = new BooleanQueryImpl ();
/*BooleanQuery folderBooleanQuery = BooleanQueryFactoryUtil.create(
searchContext);*/
folderBooleanQuery.addRequiredTerm(Field.FOLDER_ID, folderId);
/*BooleanClause folderFieldClause = BooleanClauseFactoryUtil.create(
searchContext, folderBooleanQuery,
BooleanClauseOccur.MUST.getName());*/
BooleanClause<Query> folderFieldClause =
BooleanClauseFactoryUtil.create(folderBooleanQuery,
BooleanClauseOccur.MUST.getName());
fieldClauses.add(folderFieldClause);
}