Merge pull request #5632 from sleuthkit/6036_optimize

6036: reduce cache processing time. Ignore associated objects and min…
This commit is contained in:
Richard Cordovano 2020-02-14 16:39:04 -05:00 committed by GitHub
commit c6d96f507f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 12 deletions

View File

@ -46,16 +46,6 @@ class ArtifactTextExtractor implements TextExtractor {
// "content" string to be indexed. // "content" string to be indexed.
StringBuilder artifactContents = new StringBuilder(); StringBuilder artifactContents = new StringBuilder();
Content dataSource = null;
try {
dataSource = artifact.getDataSource();
} catch (TskCoreException tskCoreException) {
throw new InitReaderException("Unable to get datasource for artifact: " + artifact.toString(), tskCoreException);
}
if (dataSource == null) {
throw new InitReaderException("Datasource was null for artifact: " + artifact.toString());
}
try { try {
for (BlackboardAttribute attribute : artifact.getAttributes()) { for (BlackboardAttribute attribute : artifact.getAttributes()) {
artifactContents.append(attribute.getAttributeType().getDisplayName()); artifactContents.append(attribute.getAttributeType().getDisplayName());
@ -67,7 +57,7 @@ class ArtifactTextExtractor implements TextExtractor {
// in the Autopsy datamodel. // in the Autopsy datamodel.
switch (attribute.getValueType()) { switch (attribute.getValueType()) {
case DATETIME: case DATETIME:
artifactContents.append(ContentUtils.getStringTime(attribute.getValueLong(), dataSource)); artifactContents.append(ContentUtils.getStringTime(attribute.getValueLong(), artifact));
break; break;
default: default:
artifactContents.append(attribute.getDisplayString()); artifactContents.append(attribute.getDisplayString());

View File

@ -457,7 +457,8 @@ public class SolrSearchService implements KeywordSearchService, AutopsyService {
@Subscribe @Subscribe
void handleNewArtifacts(Blackboard.ArtifactsPostedEvent event) { void handleNewArtifacts(Blackboard.ArtifactsPostedEvent event) {
for (BlackboardArtifact artifact : event.getArtifacts()) { for (BlackboardArtifact artifact : event.getArtifacts()) {
if (artifact.getArtifactTypeID() != BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) { //don't index KWH artifacts. if ((artifact.getArtifactTypeID() != BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) && // don't index KWH bc it's based on existing indexed text
(artifact.getArtifactTypeID() != BlackboardArtifact.ARTIFACT_TYPE.TSK_ASSOCIATED_OBJECT.getTypeID())){ //don't index AO bc it has only an artifact ID - no useful text
try { try {
index(artifact); index(artifact);
} catch (TskCoreException ex) { } catch (TskCoreException ex) {