if (Pattern.matches(regexQuery, value)) {
if (partialResults == null) {
partialResults = new ArrayList<SearchResult>();
}
partialResults.add(new SearchResult(id, multiplier,
contentType, projectID));
}
}
}
} else {
Logger.debug("advanced subquery: " + splitQuery[m]);
partialResults = performQueryNewer(splitQuery[m]
.substring(splitQuery[m].indexOf(':') + 1), searchType,
projectID, activeOnly, allowsZero, metadataId, null,
includeSupportProjects, includeOnly, username,
updateDateStart, updateDateEnd);
}
if (partialResults != null) {
if (results.size() == 0) {
Logger.debug("===>>> adding results: "
+ partialResults.size());
results.addAll(partialResults);
} else {
if ((searchType == SearchType.AND)
|| ((searchType == SearchType.REGEX))) {
for (int n = results.size() - 1; n >= 0; n--) {
if (!partialResults.contains(results.get(n))) {
Logger.debug("===>>> remove result: "
+ results.get(n));
results.remove(n);
} else {
SearchResult firstResult = results.get(n);
SearchResult secondResult = partialResults
.get(partialResults.indexOf(results
.get(n)));
firstResult.setWeight(firstResult.getWeight()
+ secondResult.getWeight());
}
}
} else if (searchType == SearchType.OR) {
for (int n = partialResults.size() - 1; n >= 0; n--) {
if (!results.contains(partialResults.get(n))) {
Logger.debug("===>>> adding result: "
+ partialResults.get(n));
results.add(partialResults.get(n));
} else {
SearchResult firstResult = partialResults
.get(n);
SearchResult secondResult = results.get(results
.indexOf(partialResults.get(n)));
secondResult.setWeight(secondResult.getWeight()
+ firstResult.getWeight());
}
}
}
}