mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(index) Fix bug related to debug print statements
This commit is contained in:
parent
ac2d7034db
commit
cb55c76664
@ -50,8 +50,8 @@ public class SearchTermsService {
|
||||
}
|
||||
|
||||
// we don't care if we can't find these:
|
||||
addEachTerm(excludes, request.searchTermsExclude);
|
||||
addEachTerm(priority, request.searchTermsPriority);
|
||||
addEachNonMandatoryTerm(excludes, request.searchTermsExclude);
|
||||
addEachNonMandatoryTerm(priority, request.searchTermsPriority);
|
||||
|
||||
return new SearchIndexSearchTerms(includes, excludes, priority, coherences);
|
||||
}
|
||||
@ -59,11 +59,11 @@ public class SearchTermsService {
|
||||
private boolean addEachTerm(IntList ret, List<String> words) {
|
||||
boolean success = true;
|
||||
|
||||
for (var exclude : words) {
|
||||
var word = lookUpWord(exclude);
|
||||
for (var word : words) {
|
||||
var termId = lookUpWord(word);
|
||||
|
||||
if (word.isPresent()) {
|
||||
lookUpWord(exclude).ifPresent(ret::add);
|
||||
if (termId.isPresent()) {
|
||||
lookUpWord(word).ifPresent(ret::add);
|
||||
}
|
||||
else {
|
||||
success = false;
|
||||
@ -72,6 +72,12 @@ public class SearchTermsService {
|
||||
return success;
|
||||
}
|
||||
|
||||
private void addEachNonMandatoryTerm(IntList ret, List<String> words) {
|
||||
for (var word : words) {
|
||||
ret.add(lexicon.get(word));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public OptionalInt lookUpWord(String s) {
|
||||
int ret = lexicon.get(s);
|
||||
|
Loading…
Reference in New Issue
Block a user