diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/AutocompleteController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/AutocompleteController.java index f2d23df17..602e11fbc 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/AutocompleteController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/AutocompleteController.java @@ -59,7 +59,7 @@ import freemarker.template.Configuration; * through a Lucene search. */ -public class AutocompleteController extends BaseSearchController implements Searcher{ +public class AutocompleteController extends FreemarkerHttpServlet implements Searcher{ private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(AutocompleteController.class); @@ -282,8 +282,6 @@ public class AutocompleteController extends BaseSearchController implements Sear // of wildcard and non-wildcard queries. The query will look have only an implicit disjunction // operator: e.g., +(name:tales name:tales*) try { - querystr = cleanQueryString(querystr); - log.debug("Adding non-wildcard query for " + querystr); Query query = parser.parse(querystr); boolQuery.add(query, BooleanClause.Occur.SHOULD); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/BaseSearchController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/BaseSearchController.java deleted file mode 100644 index 055baa551..000000000 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/BaseSearchController.java +++ /dev/null @@ -1,26 +0,0 @@ -/* $This file is distributed under the terms of the license in /doc/license.txt$ */ - -package edu.cornell.mannlib.vitro.webapp.search.controller; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; - -public class BaseSearchController extends FreemarkerHttpServlet { - - private static final long serialVersionUID = 1L; - private static final Log log = LogFactory.getLog(AutocompleteController.class); - - protected String cleanQueryString(String querystr) { - log.debug("Query string is '" + querystr + "'"); - - // Prevent org.apache.lucene.queryParser.ParseException: - // Cannot parse 'mary *': '*' or '?' not allowed as first character in WildcardQuery - // The * is redundant in this case anyway, so just remove it. - querystr = querystr.replaceAll("([\\s^])[?*]", "$1"); - - log.debug("Cleaned query string is '" + querystr + "'"); - return querystr; - } -} diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/FreemarkerPagedSearchController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/FreemarkerPagedSearchController.java index 4fc8d585f..380da7cfe 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/FreemarkerPagedSearchController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/FreemarkerPagedSearchController.java @@ -83,7 +83,7 @@ import freemarker.template.Configuration; * Rewritten to use Freemarker: rjy7 * */ -public class FreemarkerPagedSearchController extends BaseSearchController implements Searcher { +public class FreemarkerPagedSearchController extends FreemarkerHttpServlet implements Searcher { private static final long serialVersionUID = 1L; private static final Log log = LogFactory.getLog(FreemarkerPagedSearchController.class.getName()); @@ -524,8 +524,6 @@ public class FreemarkerPagedSearchController extends BaseSearchController implem return null; } QueryParser parser = getQueryParser(analyzer); - - querystr = cleanQueryString(querystr); query = parser.parse(querystr); String alpha = request.getParameter("alpha");