Message Boards

Liferay 7.2 - Hits query is returning the DDMStructure default value

Fabio Carvalho, modified 3 Years ago.

Liferay 7.2 - Hits query is returning the DDMStructure default value

Junior Member Posts: 81 Join Date: 6/25/19 Recent Posts
Hi,

I am doing some queries to my "STRUCTURE_KEY" Web Contents with a Hits query:
Hits hits = JournalArticleLocalServiceUtil.search(
    myGroup.getCompanyId(), 
    myGroup.getGroupId(), 
    Arrays.asList(JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID), 
    JournalArticleConstants.CLASSNAME_ID_DEFAULT, 
    "STRUCTURE_KEY", 
    null, 
    null, 
    null, 
    0, 
    16, 
    SortFactoryUtil.create(Field.MODIFIED_DATE, Sort.DOUBLE_TYPE, true)
);

The problem is that I was testing the DDMStructure default values, and by mistake I hit save and saved the default values. Now the Hits query is returning the DDMStructure default values as a Web Content. Is there any way to exclude this DDMStructure default values from the query? I thought that by setting "JournalArticleConstants.CLASSNAME_ID_DEFAULT" as a param, would return only the JournalArticle objects and not the DDMStructure default values also. Am I missing something here?