Package sk.iway.iwcm.rag.rest
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsearch(String query, String language, 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.Methods inherited from class sk.iway.iwcm.rest.RestController
isIpAddressAllowed
-
Constructor Details
-
MarkdownSearchRestController
-
-
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 termslanguage- documentation language codedirectory- optional viewer directory including its language, such as /sk/admin/; descendants are always includedrequest- request used for access checks and AI provider callsresponse- 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
-