do not allow search results with more than 100k docs

a) they take a long time to compute
b) danger of OOM
c) they should drill down
This commit is contained in:
ahr
2017-12-10 09:19:28 +01:00
parent a6a2236d18
commit 06d25e7ceb

View File

@@ -129,6 +129,9 @@ public class TagsToFile implements AutoCloseable {
final List<TagSpecificBaseDir> result = new ArrayList<>();
final List<Doc> searchResult = db.search(query);
if (searchResult.size() > 100_000){
throw new IllegalStateException("Too many results.");
}
for (final Doc document : searchResult) {