VIVO-742 Many changes to remove "solr" from the code base.

Comments, template names, Java classes, variables and method names (Java and JavaScript), etc.
This commit is contained in:
Jim Blake 2014-04-23 14:20:14 -04:00
parent cceca1659b
commit ad9c08cf28
29 changed files with 97 additions and 103 deletions

View file

@ -454,7 +454,7 @@ public class JSONReconcileServlet extends VitroHttpServlet {
}
private String escapeWhitespaceInQueryString(String queryStr) {
// Solr wants whitespace to be escaped with a backslash
// The search engine wants whitespace to be escaped with a backslash
return queryStr.replaceAll("\\s+", "\\\\ ");
}

View file

@ -2,7 +2,6 @@
package edu.cornell.mannlib.vitro.webapp.controller.json;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -14,7 +13,6 @@ import org.json.JSONException;
import org.json.JSONObject;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService;
@ -26,11 +24,11 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.Individual
* Does a Solr search for individuals, and uses the short view to render each of
* the results.
*/
public class GetRandomSolrIndividualsByVClass extends GetSearchIndividualsByVClass {
public class GetRandomSearchIndividualsByVClass extends GetSearchIndividualsByVClass {
private static final Log log = LogFactory
.getLog(GetRandomSolrIndividualsByVClass.class);
.getLog(GetRandomSearchIndividualsByVClass.class);
protected GetRandomSolrIndividualsByVClass(VitroRequest vreq) {
protected GetRandomSearchIndividualsByVClass(VitroRequest vreq) {
super(vreq);
}

View file

@ -2,7 +2,6 @@
package edu.cornell.mannlib.vitro.webapp.controller.json;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -14,7 +13,6 @@ import org.json.JSONException;
import org.json.JSONObject;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService;
@ -23,14 +21,14 @@ import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceSetup
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModel;
/**
* Does a Solr search for individuals, and uses the short view to render each of
* Does a search for individuals, and uses the short view to render each of
* the results.
*/
public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVClasses {
public class GetRenderedSearchIndividualsByVClass extends GetSearchIndividualsByVClasses {
private static final Log log = LogFactory
.getLog(GetRenderedSolrIndividualsByVClass.class);
.getLog(GetRenderedSearchIndividualsByVClass.class);
protected GetRenderedSolrIndividualsByVClass(VitroRequest vreq) {
protected GetRenderedSearchIndividualsByVClass(VitroRequest vreq) {
super(vreq);
}
@ -62,8 +60,6 @@ public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVC
return rObj;
}
//Get
/**
* Look through the return object. For each individual, render the short
* view and insert the resulting HTML into the object.

View file

@ -28,7 +28,7 @@ public class GetSearchIndividualsByVClasses extends JsonObjectProducer {
protected JSONObject process() throws Exception {
log.debug("Executing retrieval of individuals by vclasses");
VClass vclass=null;
log.debug("Retrieving solr individuals by vclasses");
log.debug("Retrieving search individuals by vclasses");
// Could have multiple vclass ids sent in
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){

View file

@ -69,10 +69,10 @@ public class JsonServlet extends VitroHttpServlet {
throw new IllegalArgumentException("The call invoked deprecated classes " +
"and the parameter for this call appeared nowhere in the code base, " +
"so it was removed in Aug 5th 2013.");
}else if( vreq.getParameter("getRenderedSolrIndividualsByVClass") != null ){
new GetRenderedSolrIndividualsByVClass(vreq).process(resp);
}else if( vreq.getParameter("getRandomSolrIndividualsByVClass") != null ){
new GetRandomSolrIndividualsByVClass(vreq).process(resp);
}else if( vreq.getParameter("getRenderedSearchIndividualsByVClass") != null ){
new GetRenderedSearchIndividualsByVClass(vreq).process(resp);
}else if( vreq.getParameter("getRandomSearchIndividualsByVClass") != null ){
new GetRandomSearchIndividualsByVClass(vreq).process(resp);
} else if( vreq.getParameter("getAllVClasses") != null ){
new GetAllVClasses(vreq).process(resp);
}
@ -132,7 +132,7 @@ public class JsonServlet extends VitroHttpServlet {
return IndividualListResultsUtils.wrapIndividualListResultsInJson(vcResults, vreq, false);
}
//Including version for Random Solr query for Vclass Intersections
//Including version for Random search query for Vclass Intersections
private static IndividualListResults getRandomSearchVClassResults(String vclassURI, VitroRequest vreq){
log.debug("Retrieving random search intersection results for " + vclassURI);

View file

@ -133,7 +133,7 @@ public class DisplayVocabulary {
public static final String FIXED_HTML_VALUE = DISPLAY_NS + "htmlValue";
/* URI of property for Solr Query Generator */
/* URI of property for Search Query Generator */
public static final String VCLASSID = DISPLAY_NS + "hasVClassId";

View file

@ -526,7 +526,7 @@ private String getExistingIsSelfContainedTemplateQuery() {
MenuManagementDataUtils.includeRequiredSystemData(vreq.getSession().getServletContext(), data);
data.put("classGroup", new ArrayList<String>());
data.put("classGroups", DataGetterUtils.getClassGroups(vreq));
//for solr individuals data get getter
//for search individuals data get getter
data.put("classes", this.getAllVClasses(vreq));
data.put("availablePermissions", this.getAvailablePermissions(vreq));
data.put("availablePermissionOrderedList", this.getAvailablePermissonsOrderedURIs());
@ -671,9 +671,9 @@ private String getExistingIsSelfContainedTemplateQuery() {
return query;
}
//Get all vclasses for the list of vclasses for solr
//Get all vclasses for the list of vclasses for search
//Originally considered using an ajax request to get the vclasses list which is fine for adding a new content type
//but for an existing solr content type, would need to make yet another ajax request which seems too much
//but for an existing search content type, would need to make yet another ajax request which seems too much
private List<HashMap<String, String>> getAllVClasses(VitroRequest vreq) {
List<VClass> vclasses = new ArrayList<VClass>();
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);

View file

@ -10,8 +10,8 @@ import edu.cornell.mannlib.vitro.webapp.search.IndexingException;
* IndexBuilder will manage getting lists of object to index and then use
* an object that implements IndexerIface to stuff the backend index.
*
* An example is SolrIndexer which is set up and associated with a
* IndexBuilder in SolrSetup.
* An example is SearchIndexer which is set up and associated with a
* IndexBuilder in SearchIndexerSetup.
*
* @author bdc34
*

View file

@ -38,8 +38,8 @@ import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread.Work
* That IndexBuilder will be associated with a object that implements the
* IndexerIface.
*
* An example of the IndexerIface is SolrIndexer. An example of the IndexBuilder
* and SolrIndexer setup is in SolrSetup.
* An example of the IndexerIface is SearchIndexer. An example of the IndexBuilder
* and SearchIndexer setup is in SearchIndexerSetup.
*
* @author bdc34
*/
@ -161,7 +161,7 @@ public class IndexController extends FreemarkerHttpServlet {
ApplicationUtils.instance().getSearchEngine().ping();
return Boolean.TRUE;
} catch (Exception e) {
log.error("Can't connect to the Solr server.", e);
log.error("Can't connect to the search engine.", e);
return Boolean.FALSE;
}
}

View file

@ -2,21 +2,23 @@
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_LOWERCASE;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_RAW;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_STEMMED;
import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_UNSTEMMED;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
public class NameBoost implements DocumentModifier {
/**
* These are the fields in the solr Document that
* These are the fields in the search Document that
* are related to the name. If you modify the schema,
* please consider if you need to change this list
* of name fields to boost.
*/
static final VitroSearchTermNames term = new VitroSearchTermNames();
String[] fieldsToBoost = {term.NAME_RAW,term.NAME_LOWERCASE,term.NAME_UNSTEMMED,term.NAME_STEMMED};
String[] fieldsToBoost = {NAME_RAW,NAME_LOWERCASE,NAME_UNSTEMMED,NAME_STEMMED};
final float boost;

View file

@ -33,7 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
* The IndexBuilder is used to rebuild or update a search index.
* There should only be one IndexBuilder in a vitro web application.
* It uses an implementation of a back-end through an object that
* implements IndexerIface. An example of a back-end is SolrIndexer.
* implements IndexerIface. An example of a back-end is SearchIndexer.
*
* See the class SearchReindexingListener for an example of how a model change
* listener can use an IndexBuilder to keep the full text index in sncy with

View file

@ -11,14 +11,12 @@ import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.search.IndexingException;
import edu.cornell.mannlib.vitro.webapp.search.beans.IndexerIface;
import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.IndividualToSearchDocument;
import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
class IndexWorkerThread extends VitroBackgroundThread{
private static final Log log = LogFactory.getLog(IndexWorkerThread.class);
protected final int threadNum;
protected IndividualToSearchDocument individualToSolrDoc;
protected final IndexerIface indexer;
protected final Iterator<Individual> individualsToIndex;
protected boolean stopRequested = false;
@ -38,6 +36,7 @@ class IndexWorkerThread extends VitroBackgroundThread{
stopRequested = true;
}
@Override
public void run(){
setWorkLevel(WorkLevel.WORKING, "indexing " + individualsToIndex + " individuals");

View file

@ -160,7 +160,7 @@ public class ClassGroupPageData extends DataGetterBase implements DataGetter{
//Get data servuice
public String getDataServiceUrl() {
return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId=");
return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId=");
}
/**

View file

@ -210,7 +210,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
//update class count based on restrict classes
private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List<VClass> restrictClasses) {
//Execute solr query that returns only count of individuals
//Execute search query that returns only count of individuals
log.debug("Entity count is " + v.getEntityCount());
List<String> classUris = new ArrayList<String>();
classUris.add(v.getURI());
@ -351,7 +351,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
//Get data servuice
public String getDataServiceUrl() {
return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId=");
return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId=");
}
/**

View file

@ -47,7 +47,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
final static Log log = LogFactory.getLog(SearchIndividualsDataGetter.class);
//default template
private final static String defaultTemplate = "menupage--defaultSolrIndividuals.ftl";
private final static String defaultTemplate = "menupage--defaultSearchIndividuals.ftl";
/**
* Constructor with display model and data getter URI that will be called by reflection.
@ -67,7 +67,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
merged.put(key, new String[] {String.valueOf(pageData.get(key))});
}
return doSolrQuery( merged);
return doSearchQuery( merged);
}
/**
@ -125,12 +125,12 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
//Partially copied from IndividualListController
private Map<String, Object> doSolrQuery( Map<String, String[]> merged) {
private Map<String, Object> doSearchQuery( Map<String, String[]> merged) {
if(vclassUris.size() == 0) {
if(merged.containsKey("vclassuri")) {
this.vclassUris = Arrays.asList(merged.get("vclassuri"));
} else {
log.error("No vclass uri found. Solr query will not work");
log.error("No vclass uri found. Search query will not work");
}
}
@ -160,7 +160,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
body.put("subtitle", vclass.getName());
}
body.put("title", title);
populateSolrQueryResults(vclass, body);
populateSearchQueryResults(vclass, body);
body.put("bodyTemplate", this.defaultTemplate);
} else {
log.error("No VClass URIs found. No query will be executed");
@ -168,7 +168,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
return body;
}
private void populateSolrQueryResults(VClass vclass, Map<String, Object> body) {
private void populateSearchQueryResults(VClass vclass, Map<String, Object> body) {
try {
String alpha = SearchQueryUtils.getAlphaParameter(vreq);
int page = SearchQueryUtils.getPageParameter(vreq);
@ -203,7 +203,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
public static final String defaultVarNameForResults = "results";
/**
* Query to get the definition of the Solr individuals data getter for a given URI.
* Query to get the definition of the search individuals data getter for a given URI.
*/
private static final String dataGetterQuery =
"PREFIX display: <" + DisplayVocabulary.DISPLAY_NS +"> \n" +