fun searchProjects()

in core/search/src/main/kotlin/io/klibs/core/search/SearchController.kt [119:156]


    fun searchProjects(
        @RequestParam("page", required = false, defaultValue = "1")
        @Parameter(
            description = "Page index beginning with 1 (1..N)",
            schema = Schema(type = "integer", minimum = "1", defaultValue = "1")
        )
        @Min(value = 0, message = "Page must be >= 0")
        page: Int,

        @RequestParam("limit", required = false, defaultValue = "20")
        @Parameter(
            description = "The size of the page to be returned",
            schema = Schema(type = "integer", minimum = "1", maximum = "100", defaultValue = "20")
        )
        @Min(value = 1, message = "Limit must be >= 1")
        @Max(value = 100, message = "Limit must be <= 100")
        limit: Int,

        @RequestBody
        @Parameter(description = "JSON body containing search parameters")
        @Valid
        searchRequest: SearchProjectsRequest
    ): List<SearchProjectResultDTO> {
        searchRequest.apply {
            val res = searchService.search(
                query = query,
                platforms = emptyList(),
                targetFilters = targetFilters,
                ownerLogin = owner,
                sort = SearchSort.findBySerializableName(sortBy),
                markers = markers,
                tags = tags,
                page = page,
                limit = limit
            )
            return res.map { it.toDTO() }
        }
    }