Rename TermsComponentQuery to RegexQuery

This commit is contained in:
Richard Cordovano 2016-10-22 18:50:32 -04:00
parent 14aae826d3
commit fedf10a67c
3 changed files with 7 additions and 7 deletions

View File

@ -62,13 +62,13 @@ class KeywordSearchQueryDelegator {
query.escape(); query.escape();
} // literal, substring match } // literal, substring match
else { else {
query = new TermsComponentQuery(keywordList, keyword); query = new RegexQuery(keywordList, keyword);
query.escape(); query.escape();
query.setSubstringQuery(); query.setSubstringQuery();
} }
} // regexp } // regexp
else { else {
query = new TermsComponentQuery(keywordList, keyword); query = new RegexQuery(keywordList, keyword);
} }
queryDelegates.add(query); queryDelegates.add(query);
} }

View File

@ -51,9 +51,9 @@ import org.sleuthkit.datamodel.TskData;
* index that match the regex. In the second step, term queries are executed for * index that match the regex. In the second step, term queries are executed for
* each matched term to produce the set of keyword hits for the regex. * each matched term to produce the set of keyword hits for the regex.
*/ */
final class TermsComponentQuery implements KeywordSearchQuery { final class RegexQuery implements KeywordSearchQuery {
private static final Logger LOGGER = Logger.getLogger(TermsComponentQuery.class.getName()); private static final Logger LOGGER = Logger.getLogger(RegexQuery.class.getName());
private static final String MODULE_NAME = KeywordSearchModuleFactory.getModuleName(); private static final String MODULE_NAME = KeywordSearchModuleFactory.getModuleName();
private static final String SEARCH_HANDLER = "/terms"; //NON-NLS private static final String SEARCH_HANDLER = "/terms"; //NON-NLS
private static final String SEARCH_FIELD = Server.Schema.CONTENT_WS.toString(); private static final String SEARCH_FIELD = Server.Schema.CONTENT_WS.toString();
@ -133,7 +133,7 @@ final class TermsComponentQuery implements KeywordSearchQuery {
// object? // object?
// TODO: Why is the search term not escaped and given substring wildcards, // TODO: Why is the search term not escaped and given substring wildcards,
// if needed, here in the constructor? // if needed, here in the constructor?
TermsComponentQuery(KeywordList keywordList, Keyword keyword) { RegexQuery(KeywordList keywordList, Keyword keyword) {
this.keywordList = keywordList; this.keywordList = keywordList;
this.keyword = keyword; this.keyword = keyword;
this.searchTerm = keyword.getSearchTerm(); this.searchTerm = keyword.getSearchTerm();
@ -203,7 +203,7 @@ final class TermsComponentQuery implements KeywordSearchQuery {
/** /**
* Gets the escaped search term for the query, assuming it has been escaped * Gets the escaped search term for the query, assuming it has been escaped
* by a call to TermsComponentQuery.escape. * by a call to RegexQuery.escape.
* *
* @return The search term, possibly escaped. * @return The search term, possibly escaped.
*/ */

View File

@ -436,7 +436,7 @@ public final class SearchRunner {
boolean isRegex = !keywordQuery.searchTermIsLiteral(); boolean isRegex = !keywordQuery.searchTermIsLiteral();
if (isRegex) { if (isRegex) {
keywordSearchQuery = new TermsComponentQuery(list, keywordQuery); keywordSearchQuery = new RegexQuery(list, keywordQuery);
} else { } else {
keywordSearchQuery = new LuceneQuery(list, keywordQuery); keywordSearchQuery = new LuceneQuery(list, keywordQuery);
keywordSearchQuery.escape(); keywordSearchQuery.escape();