From e6574df547b3558fcacc2c7ce1e292632acff27d Mon Sep 17 00:00:00 2001 From: esaunders Date: Wed, 1 Mar 2017 16:30:40 -0500 Subject: [PATCH] It turns out that we don't need to tell LuceneQuery to use the content_str field after all. --- .../autopsy/keywordsearch/HighlightedText.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java index 85a57f101c..8ac4e29d53 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/HighlightedText.java @@ -183,16 +183,7 @@ class HighlightedText implements IndexedText { // hits for this keyword. Keyword keywordQuery = new Keyword(keyword, isLiteral); KeywordSearchQuery chunksQuery = new LuceneQuery(new KeywordList(Arrays.asList(keywordQuery)), keywordQuery); - if (!isLiteral) { - // For keywords produced by a regular expression search we need to - // escape the hit since it may contain special characters (e.g. / in URL hits). - chunksQuery.escape(); - // We will need to search against the content_str field. Otherwise, Solr will - // apply it's text field standard tokenizer and we won't get the desired results. - chunksQuery.setField(Server.Schema.CONTENT_STR.toString()); - // We need to wrap the keyword in *'s when searching against content_str. - chunksQuery.setSubstringQuery(); - } + chunksQuery.escape(); chunksQuery.addFilter(new KeywordQueryFilter(FilterType.CHUNK, this.objectId)); hits = chunksQuery.performQuery();