updated the use of fullHitInfo flag and list names used in KeywordSearchResultFactory, which in turn corrects how results show up in the GUI browser

This commit is contained in:
Samuel H. Kenyon 2014-04-30 15:02:43 -04:00
parent f100a31656
commit 4c0f26b324

View File

@ -172,12 +172,17 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQueryContent> {
return false;
}
//get listname
// Get listname
String listName = "";
// fullHitInfo determines whether a hit is posted in a list as a raw query string or formatted with Keyword.toString()
boolean fullHitInfo = true;
if (queryRequests.size() > 1) {
KeywordList list = KeywordSearchListsXML.getCurrent().getListWithKeyword(keywordSearchQuery.getQueryString());
if (list != null) {
listName = list.getName();
}
fullHitInfo = false;
}
final boolean literal_query = keywordSearchQuery.isLiteral();
@ -234,7 +239,7 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQueryContent> {
//cannot reuse snippet in BlackboardResultWriter
//because for regex searches in UI we compress results by showing a file per regex once (even if multiple term hits)
//whereas in bb we write every hit per file separately
new BlackboardResultWriter(queryResults, keywordSearchQuery, listName).execute();
new BlackboardResultWriter(queryResults, keywordSearchQuery, listName, fullHitInfo).execute();
return true;
}
@ -381,12 +386,14 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQueryContent> {
private String listName;
private QueryResults hits;
private Collection<BlackboardArtifact> newArtifacts = new ArrayList<>();
private boolean fullHitInfo;
private static final int QUERY_DISPLAY_LEN = 40;
BlackboardResultWriter(QueryResults hits, KeywordSearchQuery query, String listName) {
BlackboardResultWriter(QueryResults hits, KeywordSearchQuery query, String listName, boolean fullHitInfo) {
this.hits = hits;
this.query = query;
this.listName = listName;
this.fullHitInfo = fullHitInfo;
}
protected void finalizeWorker() {
@ -418,8 +425,8 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQueryContent> {
});
// Create blackboard artifacts
// notifyInbox == false, fullHitInfo == true
newArtifacts = hits.writeAllHitsToBlackBoard(query, listName, progress, null, this, false, true);
boolean notifyInbox = false;
newArtifacts = hits.writeAllHitsToBlackBoard(query, listName, progress, null, this, notifyInbox, fullHitInfo);
} finally {
finalizeWorker();
}