Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def search(request: SearchRequest): IO[CSearchPage] = {
- val lines = csearch(request)
- lines.flatMap(x =>
- x match {
- case Left(value) => for {
- result <- Stream
- .emits(value)
- .through(SnippetsGrouper.groupLines(snippetConfig))
- .drop(snippetConfig.pageSize * (request.page - 1))
- .take(snippetConfig.pageSize)
- .evalMap(createSnippet)
- .through(groupByPackage)
- .compile
- .toList
- } yield CSearchPage(result.sortBy(_.pack.name), value.size, "")
- case Right(value) => CSearchPage(?, ?, value)
- }
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement