bug fixes

Former-commit-id: 6411fe67e52a3eef4044b1d640bdfb6864c2dbf3
This commit is contained in:
Jeremy Long
2013-03-03 09:47:54 -05:00
parent ea1fb191a9
commit 5a5d699cab
5 changed files with 142 additions and 24 deletions

View File

@@ -50,7 +50,7 @@ public class CPEAnalyzer implements org.owasp.dependencycheck.analyzer.Analyzer
/**
* The maximum number of query results to return.
*/
static final int MAX_QUERY_RESULTS = 10;
static final int MAX_QUERY_RESULTS = 25;
/**
* The weighting boost to give terms when constructing the Lucene query.
*/
@@ -211,7 +211,7 @@ public class CPEAnalyzer implements org.owasp.dependencycheck.analyzer.Analyzer
if (value.startsWith("https://")) {
value = value.substring(8).replaceAll("\\.", " ");
}
if (sb.indexOf(value) < 0) {
if (sb.indexOf(" " + value + " ") < 0) {
sb.append(value).append(' ');
}
}
@@ -261,6 +261,7 @@ public class CPEAnalyzer implements org.owasp.dependencycheck.analyzer.Analyzer
if (searchString == null) {
return ret;
}
TopDocs docs = cpe.search(searchString, MAX_QUERY_RESULTS);
for (ScoreDoc d : docs.scoreDocs) {
Document doc = cpe.getDocument(d.doc);