mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Restored 'title' search to SiteService.listSites() that I had "over optimized" out - but removed *term* expansion for fields already tokenized.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13799 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -574,8 +574,8 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
||||
if (nameFilter != null && nameFilter.length() != 0)
|
||||
{
|
||||
String escNameFilter = LuceneQueryParser.escape(nameFilter.replace('"', ' '));
|
||||
// Perform a Lucene search under the Site parent node using *name* and *description* search query
|
||||
QueryParameterDefinition[] params = new QueryParameterDefinition[2];
|
||||
// Perform a Lucene search under the Site parent node using *name*, title and description search query
|
||||
QueryParameterDefinition[] params = new QueryParameterDefinition[3];
|
||||
params[0] = new QueryParameterDefImpl(
|
||||
ContentModel.PROP_NAME,
|
||||
dictionaryService.getDataType(
|
||||
@@ -584,6 +584,13 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
||||
escNameFilter);
|
||||
|
||||
params[1] = new QueryParameterDefImpl(
|
||||
ContentModel.PROP_TITLE,
|
||||
dictionaryService.getDataType(
|
||||
DataTypeDefinition.TEXT),
|
||||
true,
|
||||
escNameFilter);
|
||||
|
||||
params[2] = new QueryParameterDefImpl(
|
||||
ContentModel.PROP_DESCRIPTION,
|
||||
dictionaryService.getDataType(
|
||||
DataTypeDefinition.TEXT),
|
||||
@@ -593,7 +600,9 @@ public class SiteServiceImpl implements SiteService, SiteModel
|
||||
// get the sites that match the specified names
|
||||
StringBuilder query = new StringBuilder(128);
|
||||
query.append("+PARENT:\"").append(siteRoot.toString())
|
||||
.append("\" +(@cm\\:name:\"*${cm:name}*\" @cm\\:description:\"*${cm:description}*\")");
|
||||
.append("\" +(@cm\\:name:\"*${cm:name}*\"")
|
||||
.append(" @cm\\:title:\"${cm:title}\"")
|
||||
.append(" @cm\\:description:\"${cm:description}\")");
|
||||
ResultSet results = this.searchService.query(
|
||||
siteRoot.getStoreRef(),
|
||||
SearchService.LANGUAGE_LUCENE,
|
||||
|
Reference in New Issue
Block a user