Skip to content

Commit

Permalink
[pull] master from gotson:master (#22)
Browse files Browse the repository at this point in the history
* deps(webui): bump sanitize-html from 2.11.0 to 2.12.1 in /komga-webui

Bumps [sanitize-html](https://github.com/apostrophecms/sanitize-html) from 2.11.0 to 2.12.1.
- [Changelog](https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md)
- [Commits](apostrophecms/sanitize-html@2.11.0...2.12.1)

---
updated-dependencies:
- dependency-name: sanitize-html
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix(api): cap search results to avoid SQLITE_TOOBIG

Closes: gotson#1428

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Gauthier Roebroeck <[email protected]>
  • Loading branch information
3 people authored Mar 8, 2024
1 parent a8ba497 commit 8e081c6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import java.util.concurrent.ScheduledFuture

private val logger = KotlinLogging.logger {}

private const val MAX_RESULTS = 1000

@Component
class LuceneHelper(
private val directory: Directory,
Expand Down Expand Up @@ -79,7 +81,7 @@ class LuceneHelper(
.build()

val searcher = searcherManager.acquire()
val topDocs = searcher.search(booleanQuery, Int.MAX_VALUE)
val topDocs = searcher.search(booleanQuery, MAX_RESULTS)
topDocs.scoreDocs.map { searcher.storedFields().document(it.doc)[entity.id] }
} catch (e: ParseException) {
emptyList()
Expand Down

0 comments on commit 8e081c6

Please sign in to comment.