Package org.codelibs.fess.api.v2
Class SearchApiV2Manager
java.lang.Object
org.codelibs.fess.api.BaseApiManager
org.codelibs.fess.api.v2.SearchApiV2Manager
- All Implemented Interfaces:
WebApiManager
Web API manager for the
/api/v2 surface.
This manager registers itself under the /api/v2 path prefix and
dispatches by sub-path to DI-managed handlers.
All responses use V2EnvelopeWriter so the wire shape stays uniform:
a top-level {"response": {...}} envelope with status plus
either a payload or an error object.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.codelibs.fess.api.BaseApiManager
BaseApiManager.FormatType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CacheHandlerHandlesGET /api/v2/cache/{id}(cached document content).protected ChatHandlerHandlesPOST /api/v2/chat(single-shot chat completion).protected ChatSessionClearHandlerHandlesDELETE /api/v2/chat/sessions/{session_id}(clear a chat session).protected ChatStreamHandlerHandlesPOST /api/v2/chat/stream(server-sent-event chat stream).protected ClickHandlerHandlesPOST /api/v2/click(click-through logging).protected FavoriteGetHandlerHandlesGET /api/v2/documents/{id}/favorite(read favorite state).protected FavoritePostHandlerHandlesPOST /api/v2/documents/{id}/favorite(toggle favorite state).protected FavoritesListHandlerHandlesGET /api/v2/favorites(list favorited doc ids in a previously issued search result).protected HealthHandlerHandlesGET /api/v2/health.protected LabelsHandlerHandlesGET /api/v2/labels.protected LoginHandlerHandlesPOST /api/v2/auth/login.protected LogoutHandlerHandlesPOST /api/v2/auth/logout.protected MeHandlerHandlesGET /api/v2/auth/me(current authenticated user).protected OriginValidatorValidates the request origin for the baseline CSRF Origin layer (unsafe methods).protected PasswordChangeHandlerHandlesPOST /api/v2/auth/password(change the current user's password).protected PopularWordsHandlerHandlesGET /api/v2/popular-words.protected RelatedContentHandlerHandlesGET /api/v2/related-content(related HTML content).protected RelatedQueriesHandlerHandlesGET /api/v2/related-queries(related query suggestions).protected ScrollSearchHandlerHandlesGET /api/v2/documents/all(scroll over all matching documents).protected SearchHandlerHandlesPOST /api/v2/search.protected SuggestWordsHandlerHandlesGET /api/v2/suggest-words.protected UiConfigHandlerHandlesGET /api/v2/ui/config(SPA bootstrap configuration).Fields inherited from class org.codelibs.fess.api.BaseApiManager
pathPrefix -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(jakarta.servlet.http.HttpServletRequest request) Checks if the request matches this API manager.voidprocess(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) Processes the request through this API manager.voidregister()Registers this manager with the globalWebApiManagerFactoryonce Lasta DI finishes injecting dependencies.protected voidwriteHeaders(jakarta.servlet.http.HttpServletResponse response) Writes custom headers to the HTTP response.Methods inherited from class org.codelibs.fess.api.BaseApiManager
detectFormatType, getFormatType, getPathPrefix, setPathPrefix, write
-
Field Details
-
searchHandler
HandlesPOST /api/v2/search. -
scrollSearchHandler
HandlesGET /api/v2/documents/all(scroll over all matching documents). -
favoriteGetHandler
HandlesGET /api/v2/documents/{id}/favorite(read favorite state). -
favoritePostHandler
HandlesPOST /api/v2/documents/{id}/favorite(toggle favorite state). -
favoritesListHandler
HandlesGET /api/v2/favorites(list favorited doc ids in a previously issued search result). -
meHandler
HandlesGET /api/v2/auth/me(current authenticated user). -
logoutHandler
HandlesPOST /api/v2/auth/logout. -
passwordChangeHandler
HandlesPOST /api/v2/auth/password(change the current user's password). -
uiConfigHandler
HandlesGET /api/v2/ui/config(SPA bootstrap configuration). -
clickHandler
HandlesPOST /api/v2/click(click-through logging). -
chatHandler
HandlesPOST /api/v2/chat(single-shot chat completion). -
chatStreamHandler
HandlesPOST /api/v2/chat/stream(server-sent-event chat stream). -
chatSessionClearHandler
HandlesDELETE /api/v2/chat/sessions/{session_id}(clear a chat session). -
cacheHandler
HandlesGET /api/v2/cache/{id}(cached document content). -
healthHandler
HandlesGET /api/v2/health. -
suggestWordsHandler
HandlesGET /api/v2/suggest-words. -
labelsHandler
HandlesGET /api/v2/labels. -
popularWordsHandler
HandlesGET /api/v2/popular-words. -
loginHandler
HandlesPOST /api/v2/auth/login. -
originValidator
Validates the request origin for the baseline CSRF Origin layer (unsafe methods).
-
-
Constructor Details
-
SearchApiV2Manager
public SearchApiV2Manager()Constructor — pins the path prefix to/api/v2.
-
-
Method Details
-
register
@PostConstruct public void register()Registers this manager with the globalWebApiManagerFactoryonce Lasta DI finishes injecting dependencies. -
matches
public boolean matches(jakarta.servlet.http.HttpServletRequest request) Description copied from interface:WebApiManagerChecks if the request matches this API manager.- Parameters:
request- The HTTP servlet request.- Returns:
- True if the request matches, false otherwise.
-
process
public void process(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException Description copied from interface:WebApiManagerProcesses the request through this API manager.- Parameters:
request- The HTTP servlet request.response- The HTTP servlet response.chain- The filter chain.- Throws:
IOException- If an input/output error occurs.jakarta.servlet.ServletException- If a servlet error occurs.
-
writeHeaders
protected void writeHeaders(jakarta.servlet.http.HttpServletResponse response) Description copied from class:BaseApiManagerWrites custom headers to the HTTP response.- Specified by:
writeHeadersin classBaseApiManager- Parameters:
response- The HTTP servlet response.
-