Class MarkdownSearchService

java.lang.Object
sk.iway.iwcm.rag.search.MarkdownSearchService

@Service public class MarkdownSearchService extends Object
Searches configured Markdown documentation using the shared semantic, hybrid and RAG pipelines.
  • Constructor Details

  • Method Details

    • search

      public MarkdownSearchService.SearchResponse search(String query, String language, String directory, Integer domainId, jakarta.servlet.http.HttpServletRequest request)
      Searches accessible globally configured roots in the selected language in the shared Markdown domain zero. Search availability is checked before validation, source access and cache lookup. Access checks run before embeddings and again for individual sources before answer generation. Embeddings and answers use the requesting domain's assistants, credentials and usage accounting. Answers are generated automatically when ragAnswerAllowed is enabled and authorized context is available. When ragMarkdownSearchRequireLogin is enabled, any authenticated user can search; administrator access is not required. The shared search spam protection limits requests before any AI provider call. Retrieval and answers are cached for 30 minutes using a lowercase, accent-free question key. Cached chunks are authorized again and the current answer setting is checked on every request. Missing cached chunk IDs trigger fresh retrieval after reindexing or deletion.
      Parameters:
      query - question or search terms
      language - required documentation language
      directory - optional viewer directory including its language and leading/trailing slashes; descendants are always included
      domainId - current request domain used for assistants and usage, not Markdown storage
      request - current HTTP request used for access checks and AI providers
      Returns:
      unique source results with optional plain-text and safe HTML answers