mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-20 03:24:55 +00:00
Merge pull request #2580 from millmanorama/2324-save-hits-w/out-snippets
2324 save hits w/out snippets
This commit is contained in:
commit
3d4b530590
@ -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,16 +153,14 @@ class QueryResults {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (snippet != null) {
|
||||
KeywordCachedArtifact writeResult = keywordSearchQuery.writeSingleFileHitsToBlackBoard(keyword, hit, snippet, keywordList.getName());
|
||||
if (writeResult != null) {
|
||||
newArtifacts.add(writeResult.getArtifact());
|
||||
if (notifyInbox) {
|
||||
writeSingleFileInboxMessage(writeResult, hit.getContent());
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.WARNING, "BB artifact for keyword hit not written, file: {0}, hit: {1}", new Object[]{hit.getContent(), keyword.toString()}); //NON-NLS
|
||||
KeywordCachedArtifact writeResult = keywordSearchQuery.writeSingleFileHitsToBlackBoard(keyword, hit, snippet, keywordList.getName());
|
||||
if (writeResult != null) {
|
||||
newArtifacts.add(writeResult.getArtifact());
|
||||
if (notifyInbox) {
|
||||
writeSingleFileInboxMessage(writeResult, hit.getContent());
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.WARNING, "BB artifact for keyword hit not written, file: {0}, hit: {1}", new Object[]{hit.getContent(), keyword.toString()}); //NON-NLS
|
||||
}
|
||||
}
|
||||
++unitProgress;
|
||||
|
Loading…
x
Reference in New Issue
Block a user