. Fix for AWC-498

- Searching for results in a Location (e.g. PATH) and category are now ANDed together rather than ORed

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2300 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-02-06 11:13:55 +00:00
parent 8ba6c27fe0
commit 93046ae638

View File

@@ -241,16 +241,20 @@ public final class SearchContext implements Serializable
if (location != null)
{
pathQuery.append(" PATH:\"").append(location).append("\" ");
if (categories != null && categories.length != 0)
{
pathQuery.append("AND");
}
}
if (categories != null && categories.length != 0)
{
for (int i=0; i<categories.length; i++)
{
if (pathQuery.length() != 0)
if (i > 0)
{
pathQuery.append("OR");
}
pathQuery.append(" PATH:\"").append(categories[i]).append("\" ");
pathQuery.append(" PATH:\"").append(categories[i]).append("\" ");
}
}
}