Changeset 6802 for SRUAggregator
- Timestamp:
- 11/13/15 10:04:55 (9 years ago)
- Location:
- SRUAggregator/trunk/src
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/search/Search.java
r6395 r6802 44 44 private final List<Result> results = Collections.synchronizedList(new ArrayList<Result>()); 45 45 private final Statistics statistics; 46 private final Pattern wsPattern = Pattern.compile("\\s");46 private static final Pattern quotePattern = Pattern.compile("[\\s<>=/\\(\\)]"); 47 47 48 48 public Search(ThrottledClient searchClient, … … 54 54 this.version = version; 55 55 this.id = counter.getAndIncrement(); 56 this.query = quoteIf MultiWordExpression(searchString);56 this.query = quoteIfQuotableExpression(searchString); 57 57 this.searchLanguage = searchLanguage; 58 58 this.statistics = statistics; … … 177 177 } 178 178 179 pr ivate String quoteIfMultiWordExpression(String queryString) {180 Matcher matcher = wsPattern.matcher(queryString.trim());181 boolean wsFound = matcher.find();182 if ( wsFound && !"\"".equals(queryString.charAt(0))) {179 protected static String quoteIfQuotableExpression(final String queryString) { 180 Matcher matcher = quotePattern.matcher(queryString.trim()); 181 boolean quotableFound = matcher.find(); 182 if (quotableFound && !"\"".equals(queryString.charAt(0))) { 183 183 return "\"" + queryString + "\""; 184 184 }
Note: See TracChangeset
for help on using the changeset viewer.