Merge pull request #2580 from millmanorama/2324-save-hits-w/out-snippets

2324 save hits w/out snippets
This commit is contained in:
Richard Cordovano 2017-03-09 09:17:47 -05:00 committed by GitHub
commit 3d4b530590

View File

@ -138,7 +138,11 @@ class QueryResults {
if (StringUtils.isBlank(snippet)) {
final String snippetQuery = KeywordSearchUtil.escapeLuceneQuery(termString);
try {
//this doesn't work for regex queries...
/*
* this doesn't work for regex queries... But that is
* okay because regex queries always have snippets made
* from the content_str field we pull back from Solr
*/
snippet = LuceneQuery.querySnippet(snippetQuery, hit.getSolrObjectId(), hit.getChunkId(), !keywordSearchQuery.isLiteral(), true);
} catch (NoOpenCoreException e) {
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e); //NON-NLS
@ -149,7 +153,6 @@ class QueryResults {
continue;
}
}
if (snippet != null) {
KeywordCachedArtifact writeResult = keywordSearchQuery.writeSingleFileHitsToBlackBoard(keyword, hit, snippet, keywordList.getName());
if (writeResult != null) {
newArtifacts.add(writeResult.getArtifact());
@ -160,7 +163,6 @@ class QueryResults {
logger.log(Level.WARNING, "BB artifact for keyword hit not written, file: {0}, hit: {1}", new Object[]{hit.getContent(), keyword.toString()}); //NON-NLS
}
}
}
++unitProgress;
}