I am running Alfresco 201605 community.
Considering the following Javascript:
function findJs(skipCount, pageSize) {
var q = {
query: 'TYPE:"my:customType"',
language: 'fts-alfresco',
store: 'workspace://SpacesStore',
page: {
maxItems: pageSize,
skipCount: skipCount
}
};
return search.query(q);
}
logger.log(findJs(0, 100).length);
logger.log(findJs(1000, 100).length);I know I have 11.025 nodes in Alfresco that are searchable and should be included in the result for this query. However, this prints:
100
0
When I change the query to include a property filter that matches all 11.025 nodes, as follows:
function findJs(skipCount, pageSize) {
var q = {
query: 'TYPE:"my:customType" AND (my:prop:"Textvalue")',
language: 'fts-alfresco',
store: 'workspace://SpacesStore',
page: {
maxItems: pageSize,
skipCount: skipCount
}
};
return search.query(q);
}
logger.log(findJs(0, 100).length);
logger.log(findJs(1000, 100).length);This prints
100
100
Interestingly, executing this in Java, the following:
ResultSet rs = searchService.query(searchParameters);
logger.debug(rs.hasMore());
logger.debug(rs.length());
Will log
true
0
when not filtering on a prop value, and
true
100
as expected when filtering on a prop value.
What might cause this difference in behavior when I query with and without a property value filter?