Class MarkdownSearchRestController

java.lang.Object
sk.iway.iwcm.rest.RestController
sk.iway.iwcm.rag.rest.MarkdownSearchRestController

@RestController @RequestMapping("/rest/rag/markdown") public class MarkdownSearchRestController extends RestController
Read-only search API shared by public and authenticated Docsify documentation.
  • Constructor Details

    • MarkdownSearchRestController

      public MarkdownSearchRestController(MarkdownSearchService searchService)
  • Method Details

    • search

      @GetMapping("/search") public MarkdownSearchService.SearchResponse search(@RequestParam("query") String query, @RequestParam("language") String language, @RequestParam(value="directory",required=false) String directory, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Searches authorized documentation roots, generates an answer when ragAnswerAllowed is enabled, and disables caching of the response. Access uses restAllowedIpAddresses-MarkdownSearchRestController, falling back to restAllowedIpAddresses. Login is controlled by ragMarkdownSearchRequireLogin and does not require an administrator role.
      Parameters:
      query - question or search terms
      language - documentation language code
      directory - optional viewer directory including its language, such as /sk/admin/; descendants are always included
      request - request used for access checks and AI provider calls
      response - response whose cache policy is set to no-store
      Returns:
      matching sources and an optional plain-text answer
      Throws:
      org.springframework.web.server.ResponseStatusException - if input is invalid, access is denied, or the search rate limit is exceeded