19 package org.sleuthkit.autopsy.keywordsearch;
21 import java.io.IOException;
22 import java.util.HashMap;
27 import org.apache.solr.common.util.ContentStreamBase.StringStream;
28 import org.openide.util.lookup.ServiceProvider;
39 @ServiceProvider(service = KeywordSearchService.class)
48 long artifactId = artifact.getArtifactID();
54 if (currentCase == null)
58 if (sleuthkitCase == null)
63 if (abstractFile != null)
68 if (dataSource == null)
73 StringBuilder artifactContents =
new StringBuilder();
76 artifactContents.append(attribute.getAttributeTypeDisplayName());
77 artifactContents.append(
" : ");
102 artifactContents.append(attribute.getDisplayString());
103 artifactContents.append(System.lineSeparator());
106 if (artifactContents.length() == 0)
116 HashMap<String, String> solrFields =
new HashMap<>();
117 String documentId = Long.toString(artifactId);
119 solrFields.put(
Server.
Schema.ID.toString(), documentId);
122 solrFields.put(
Server.
Schema.IMAGE_ID.toString(), Long.toString(dataSource.
getId()));
125 Ingester.getDefault().ingest(
new StringStream(
""), solrFields, 0);
127 catch (Ingester.IngesterException ex) {
135 documentId +=
"_" + Long.toString(chunkId);
136 solrFields.replace(
Server.
Schema.ID.toString(), documentId);
138 StringStream contentStream =
new StringStream(artifactContents.toString());
141 Ingester.getDefault().ingest(contentStream, solrFields, contentStream.getSize());
143 catch (Ingester.IngesterException ex) {
148 public void close() throws IOException {
static String getStringTime(long epochSeconds, TimeZone tzone)
void indexArtifact(BlackboardArtifact artifact)
Content getContentById(long id)
AbstractFile getAbstractFileById(long id)
SleuthkitCase getSleuthkitCase()
static Case getCurrentCase()