Skip to content

Commit

Permalink
'#1989: complement commit ea7f390: handle « » and add general protection
Browse files Browse the repository at this point in the history
  • Loading branch information
lfcnassif committed Nov 20, 2023
1 parent ea7f390 commit 934c357
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public IItemReader next() {
}

private SearchResult getResult(String luceneQuery) {
IPEDSearcher searcher = new IPEDSearcher(iSource, luceneQuery);
searcher.setTreeQuery(true);
searcher.setNoScoring(true);
try {
IPEDSearcher searcher = new IPEDSearcher(iSource, luceneQuery);
searcher.setTreeQuery(true);
searcher.setNoScoring(true);
return searcher.search();

} catch (Exception e) {
Expand All @@ -88,7 +88,8 @@ public void close() throws IOException {

@Override
public String escapeQuery(String string) {
string = string.replace('“', '"').replace('”', '"').replace('„', '"');
string = string.replace('“', '"').replace('”', '"').replace('„', '"').replace('"', '"');
string = string.replace('«', ' ').replace('»', ' ');
return QueryParserUtil.escape(string);
}

Expand Down

0 comments on commit 934c357

Please sign in to comment.