mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Merge branch 'master' of https://github.com/sleuthkit/autopsy
This commit is contained in:
commit
c03c2f40fd
@ -505,6 +505,8 @@
|
||||
-->
|
||||
|
||||
<field name="id" type="string" indexed="true" stored="true" required="true" />
|
||||
<!-- use image_id to easily search a specific image only -->
|
||||
<field name="image_id" type="string" indexed="true" stored="true" required="true" />
|
||||
<!-- The content field holds the text extracted by SolrCell -->
|
||||
<field name="content" type="text_general" indexed="true" stored="true" termVectors="true" termPositions="true" termOffsets="true" />
|
||||
<!-- The strings field holds strings extracted from files that SolrCell doesn't support -->
|
||||
|
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.keywordsearch;
|
||||
|
||||
import java.awt.ComponentOrientation;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ItemEvent;
|
||||
@ -610,6 +611,26 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Scroll to current (first) hit after SetMarkup worker completed
|
||||
*
|
||||
* @param source
|
||||
*/
|
||||
private void scrollToCurrentHit(final MarkupSource source) {
|
||||
if (source == null || !source.isSearchable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
//scrolling required invokeLater to enqueue in EDT
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
scrollToAnchor(source.getAnchorPrefix() + Integer.toString(source.currentItem()));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets and sets new markup. Updates GUI in GUI thread and gets markup in
|
||||
* background thread. To be invoked from GUI thread only.
|
||||
@ -656,6 +677,9 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
}
|
||||
updateControls(source);
|
||||
|
||||
scrollToCurrentHit(source);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -234,13 +234,10 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
if (currentPage == 0 && currentSource.hasNextPage()) {
|
||||
currentSource.nextPage();
|
||||
}
|
||||
|
||||
updatePageControls();
|
||||
|
||||
// first source will be the default displayed
|
||||
setPanel(sources);
|
||||
// If node has been selected before, return to the previous position
|
||||
scrollToCurrentHit();
|
||||
}
|
||||
|
||||
private void scrollToCurrentHit() {
|
||||
@ -249,13 +246,8 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
return;
|
||||
}
|
||||
|
||||
// using invokeLater to wait for ComboBox selection to complete
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
panel.scrollToAnchor(source.getAnchorPrefix() + Integer.toString(source.currentItem()));
|
||||
}
|
||||
});
|
||||
panel.scrollToAnchor(source.getAnchorPrefix() + Integer.toString(source.currentItem()));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,6 +54,7 @@ import org.sleuthkit.datamodel.File;
|
||||
import org.sleuthkit.datamodel.FsContent;
|
||||
import org.sleuthkit.datamodel.LayoutFile;
|
||||
import org.sleuthkit.datamodel.ReadContentInputStream;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
/**
|
||||
* Handles indexing files on a Solr core.
|
||||
@ -217,6 +218,12 @@ public class Ingester {
|
||||
private Map<String, String> getCommonFields(AbstractFile af) {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put(Server.Schema.ID.toString(), Long.toString(af.getId()));
|
||||
try {
|
||||
params.put(Server.Schema.IMAGE_ID.toString(), Long.toString(af.getImage().getId()));
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Could not get image id to properly index the file " + af.getId());
|
||||
}
|
||||
|
||||
params.put(Server.Schema.FILE_NAME.toString(), af.getName());
|
||||
return params;
|
||||
}
|
||||
@ -239,6 +246,14 @@ public class Ingester {
|
||||
* @throws org.sleuthkit.autopsy.keywordsearch.Ingester.IngesterException
|
||||
*/
|
||||
private void ingest(ContentStream cs, Map<String, String> fields, final long size) throws IngesterException {
|
||||
|
||||
if (fields.get(Server.Schema.IMAGE_ID.toString()) == null) {
|
||||
//skip the file, image id unknown
|
||||
String msg = "Skipping indexing the file, unknown image id, for file: " + cs.getName();
|
||||
logger.log(Level.SEVERE, msg);
|
||||
throw new IngesterException(msg);
|
||||
}
|
||||
|
||||
SolrInputDocument updateDoc = new SolrInputDocument();
|
||||
|
||||
for (String key : fields.keySet()) {
|
||||
|
@ -69,6 +69,12 @@ public class Server {
|
||||
return "id";
|
||||
}
|
||||
},
|
||||
IMAGE_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "image_id";
|
||||
}
|
||||
},
|
||||
CONTENT {
|
||||
@Override
|
||||
public String toString() {
|
||||
|
5
NEWS.txt
5
NEWS.txt
@ -4,7 +4,7 @@ New features:
|
||||
|
||||
Improvements:
|
||||
- Keyword search indexing and search speed improvements
|
||||
- Improved keyword search highlighting in Text View: highlighted tokens are no longer white-space separated
|
||||
- Improved keyword search highlighting in Text View: highlighted tokens are no longer delimiter separated
|
||||
- Remake of reporting UI and functionality
|
||||
- Significant increase in reporting speed
|
||||
- Documented report module API
|
||||
@ -12,7 +12,8 @@ Improvements:
|
||||
|
||||
|
||||
Bugfixes:
|
||||
- Keyword search will index and search entire extracted content from files
|
||||
- Keyword search now indexes and searches entire extracted content from files
|
||||
- Fix scrolling to first keyword hit when Text View is first loaded
|
||||
|
||||
---------------- VERSION 3.0.2 --------------
|
||||
|
||||
|
@ -104,7 +104,9 @@ public class ThunderbirdMboxFileIngestModule implements IngestModuleAbstractFile
|
||||
byte[] t = new byte[64];
|
||||
if(fsContent.getSize() > 64) {
|
||||
int byteRead = fsContent.read(t, 0, 64);
|
||||
isMbox = mbox.isValidMimeTypeMbox(t);
|
||||
if (byteRead > 0) {
|
||||
isMbox = mbox.isValidMimeTypeMbox(t);
|
||||
}
|
||||
}
|
||||
} catch (TskException ex) {
|
||||
logger.log(Level.WARNING, null, ex);
|
||||
@ -120,6 +122,8 @@ public class ThunderbirdMboxFileIngestModule implements IngestModuleAbstractFile
|
||||
Long msfId = 0L;
|
||||
currentCase = Case.getCurrentCase(); // get the most updated case
|
||||
SleuthkitCase tskCase = currentCase.getSleuthkitCase();
|
||||
|
||||
|
||||
try {
|
||||
ResultSet resultset = tskCase.runQuery("SELECT obj_id FROM tsk_files WHERE parent_path = '" + mboxPath + "' and name = '" + msfName + "'");
|
||||
if (! resultset.next()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user