Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix search when none of the index checkboxes are checked #14

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/plugins/Library/search/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
* http://www.gnu.org/ for further details of the GPL. */
package plugins.Library.search;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

Expand Down Expand Up @@ -113,10 +106,13 @@ else if(indices.length==1){
// create search for multiple terms over multiple indices
ArrayList<Execution<Set<TermEntry>>> indexrequests = new ArrayList<Execution<Set<TermEntry>>>(indices.length);
for (String index : indices){
Search indexsearch = startSearch(search, index);
if(indexsearch==null)
return null;
indexrequests.add(indexsearch);
try {
Search indexsearch = startSearch(search, index);
if(indexsearch == null) continue;
indexrequests.add(indexsearch);
} catch (InvalidSearchException ignored) { // continue
} catch (TaskAbortException ignored) { // continue
}
}
Search newSearch = new Search(search, indexuri, indexrequests, ResultOperation.DIFFERENTINDEXES);
return newSearch;
Expand Down