mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-5878 Update the live search lib file with the 5.2 version.
Keep the changes to exclude RM saved searches.
This commit is contained in:
@@ -66,8 +66,8 @@ function getSiteData(siteId) {
|
|||||||
var site = siteService.getSite(siteId);
|
var site = siteService.getSite(siteId);
|
||||||
var data =
|
var data =
|
||||||
{
|
{
|
||||||
shortName: siteId,
|
shortName : siteId,
|
||||||
title: (site !== null ? site.title : "unknown")
|
title : (site !== null ? site.title : "unknown")
|
||||||
};
|
};
|
||||||
siteDataCache[siteId] = data;
|
siteDataCache[siteId] = data;
|
||||||
return data;
|
return data;
|
||||||
@@ -123,7 +123,7 @@ function getDocumentItem(container, node) {
|
|||||||
if (node.hasAspect("{http://www.alfresco.org/model/content/1.0}thumbnailModification"))
|
if (node.hasAspect("{http://www.alfresco.org/model/content/1.0}thumbnailModification"))
|
||||||
{
|
{
|
||||||
var dates = node.properties["lastThumbnailModification"];
|
var dates = node.properties["lastThumbnailModification"];
|
||||||
for (var i = 0; i < dates.length; i++)
|
for (var i=0; i<dates.length; i++)
|
||||||
{
|
{
|
||||||
if (dates[i].indexOf("doclib") !== -1)
|
if (dates[i].indexOf("doclib") !== -1)
|
||||||
{
|
{
|
||||||
@@ -152,7 +152,7 @@ function splitQNamePath(node) {
|
|||||||
containerId: null
|
containerId: null
|
||||||
};
|
};
|
||||||
|
|
||||||
if (path.match("^" + SITES_SPACE_QNAME_PATH) == SITES_SPACE_QNAME_PATH)
|
if (path.match("^"+SITES_SPACE_QNAME_PATH) == SITES_SPACE_QNAME_PATH)
|
||||||
{
|
{
|
||||||
var tmp = path.substring(SITES_SPACE_QNAME_PATH.length),
|
var tmp = path.substring(SITES_SPACE_QNAME_PATH.length),
|
||||||
pos = tmp.indexOf('/');
|
pos = tmp.indexOf('/');
|
||||||
@@ -208,11 +208,20 @@ function getDocResults(params) {
|
|||||||
// ensure a TYPE is specified
|
// ensure a TYPE is specified
|
||||||
var ftsQuery = params.term + ' AND +TYPE:"cm:content"';
|
var ftsQuery = params.term + ' AND +TYPE:"cm:content"';
|
||||||
|
|
||||||
|
// site constraint
|
||||||
|
if (params.siteId !== null)
|
||||||
|
{
|
||||||
|
// use SITE syntax to restrict to specific site
|
||||||
|
ftsQuery += ' AND SITE:"' + params.siteId + '"';
|
||||||
|
}
|
||||||
|
|
||||||
// root node - generally used for overridden Repository root in Share
|
// root node - generally used for overridden Repository root in Share
|
||||||
if (params.rootNode !== null)
|
if (params.rootNode !== null)
|
||||||
{
|
{
|
||||||
ftsQuery = 'PATH:"' + rootNode.qnamePath + '//*" AND (' + ftsQuery + ')';
|
ftsQuery = 'PATH:"' + rootNode.qnamePath + '//*" AND (' + ftsQuery + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// main query construction
|
||||||
ftsQuery = '(' + ftsQuery + ') AND -TYPE:"cm:thumbnail" AND -TYPE:"cm:failedThumbnail" AND -TYPE:"cm:rating" AND -TYPE:"fm:post" AND -ASPECT:"sys:hidden" AND -ASPECT:"rma:savedSearch" AND -cm:creator:system';
|
ftsQuery = '(' + ftsQuery + ') AND -TYPE:"cm:thumbnail" AND -TYPE:"cm:failedThumbnail" AND -TYPE:"cm:rating" AND -TYPE:"fm:post" AND -ASPECT:"sys:hidden" AND -ASPECT:"rma:savedSearch" AND -cm:creator:system';
|
||||||
|
|
||||||
if (logger.isLoggingEnabled())
|
if (logger.isLoggingEnabled())
|
||||||
@@ -249,7 +258,7 @@ function getDocResults(params) {
|
|||||||
if (logger.isLoggingEnabled())
|
if (logger.isLoggingEnabled())
|
||||||
logger.log("Processing resultset of length: " + nodes.length);
|
logger.log("Processing resultset of length: " + nodes.length);
|
||||||
|
|
||||||
for (var i = 0, item; i < nodes.length && i < params.maxResults; i++)
|
for (var i=0, item; i<nodes.length && i<params.maxResults; i++)
|
||||||
{
|
{
|
||||||
// For each node we extract the site/container qname path and then
|
// For each node we extract the site/container qname path and then
|
||||||
// let the per-container helper function decide what to do.
|
// let the per-container helper function decide what to do.
|
||||||
|
Reference in New Issue
Block a user