From f33dd242dd87c0448f0bee66de525a391a39d76c Mon Sep 17 00:00:00 2001 From: runeliza Date: Wed, 17 Aug 2011 20:02:21 +0000 Subject: [PATCH] Modified so that it's able to search a person by email. --- .../controller/grefine/JSONReconcileServlet.java | 10 +++++++--- .../controller/grefine/JSONReconcileServletTest.java | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java index c7f3790bc..1164b383d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java @@ -241,7 +241,7 @@ public class JSONReconcileServlet extends VitroHttpServlet { // continue with properties list String searchType = null; - int limit = 3; // default + int limit = 10; // default String typeStrict = "should"; // default ArrayList propertiesList = new ArrayList(); @@ -382,15 +382,19 @@ public class JSONReconcileServlet extends VitroHttpServlet { return null; } - SolrQuery query = new SolrQuery(); + /// original + ///SolrQuery query = new SolrQuery(); + /// test + SolrQuery query = new SolrQuery(queryStr.toLowerCase()); + // original code: // query.setStart(0).setRows(DEFAULT_MAX_HIT_COUNT); // Google Refine specific: query.setStart(0).setRows(limit); // TODO: works better without using tokenizeNameQuery(), need to investigate a bit more - query.setQuery(queryStr); + /// comment out original: query.setQuery(queryStr); // Filter by type // e.g. http://xmlns.com/foaf/0.1/Person diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServletTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServletTest.java index 926db6c3c..3677d62ef 100644 --- a/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServletTest.java +++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServletTest.java @@ -94,7 +94,7 @@ public class JSONReconcileServletTest extends AbstractTestClass { } else { modStr = inputStr; } - Pattern regex = Pattern.compile(modStr); + Pattern regex = Pattern.compile(modStr, Pattern.CASE_INSENSITIVE); Matcher regexMatcher = regex.matcher(resultStr); Assert.assertTrue(message, regexMatcher.find()); } catch (PatternSyntaxException e) {