mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Improve highlight query in case of a regex with dir tree / blackboard saved results, now it should not return chunks that do not have exact regex match
This commit is contained in:
parent
752a22a7c9
commit
77d7570e48
@ -135,9 +135,13 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
chunksQuery.escape();
|
||||
}
|
||||
*/
|
||||
Keyword keywordQuery = new Keyword(this.keywordHitQuery, false);
|
||||
String queryStr = KeywordSearchUtil.escapeLuceneQuery(this.keywordHitQuery, true, false);
|
||||
if (isRegex) {
|
||||
//use white-space sep. field to get exact matches only of regex query result
|
||||
queryStr = Server.Schema.CONTENT_WS + ":" + "\"" + queryStr + "\"";
|
||||
}
|
||||
Keyword keywordQuery = new Keyword(queryStr, false);
|
||||
chunksQuery = new LuceneQuery(keywordQuery);
|
||||
chunksQuery.escape();
|
||||
KeywordQueryFilter contentIdFilter = new KeywordQueryFilter(FilterType.CHUNK, contentId);
|
||||
chunksQuery.setFilter(contentIdFilter);
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user