Package sk.iway.iwcm.rag.search
Class MarkdownSearchService
java.lang.Object
sk.iway.iwcm.rag.search.MarkdownSearchService
Searches configured Markdown documentation using the shared semantic, hybrid and RAG pipelines.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCarries ranked documentation sources and an optional generated answer.static final recordRepresents one documentation source returned to a search client. -
Constructor Summary
ConstructorsConstructorDescriptionMarkdownSearchService(MarkdownSourceService sourceService, SemanticSearchService semanticSearchService, EmbeddingChunkRepository chunkRepository, RagService ragService) -
Method Summary
-
Constructor Details
-
MarkdownSearchService
public MarkdownSearchService(MarkdownSourceService sourceService, SemanticSearchService semanticSearchService, EmbeddingChunkRepository chunkRepository, RagService ragService)
-
-
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 termslanguage- required documentation languagedirectory- optional viewer directory including its language and leading/trailing slashes; descendants are always includeddomainId- current request domain used for assistants and usage, not Markdown storagerequest- current HTTP request used for access checks and AI providers- Returns:
- unique source results with optional plain-text and safe HTML answers
-