Modified so that it's able to search a person by email.

This commit is contained in:
runeliza 2011-08-17 20:02:21 +00:00
parent ff7cbbe69b
commit f33dd242dd
2 changed files with 8 additions and 4 deletions

View file

@ -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<String[]> propertiesList = new ArrayList<String[]>();
@ -382,7 +382,11 @@ 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);
@ -390,7 +394,7 @@ public class JSONReconcileServlet extends VitroHttpServlet {
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

View file

@ -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) {