Class V2JsonRequestParams
/api/v2 surface.
Mirrors v1's SearchApiManager.JsonRequestParams inner class so the
underlying SearchHelper.search(org.codelibs.fess.entity.SearchRequestParams, org.codelibs.fess.entity.SearchRenderData, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean>) contract stays
stable across versions. Promoted to a top-level class so individual v2
handlers (search, scroll, …) can construct it without depending on the
monolithic manager. The wire-level parameter names match v1 exactly
(q, start, num, offset, ex_q,
fields.*, as.*, lang, sort, sdh) so
existing clients keep working.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThrown bygetOffset()orgetStartPosition()when theoffset/startparameter is present but negative.static classNested classes/interfaces inherited from class org.codelibs.fess.entity.SearchRequestParams
SearchRequestParams.SearchRequestType -
Field Summary
Fields inherited from class org.codelibs.fess.entity.SearchRequestParams
AS_EPQ, AS_FILETYPE, AS_NQ, AS_OCCURRENCE, AS_OQ, AS_Q, AS_SITESEARCH, AS_TIMESTAMP -
Constructor Summary
ConstructorsConstructorDescriptionV2JsonRequestParams(jakarta.servlet.http.HttpServletRequest request, org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Constructs a v2 request-params adapter over an incoming HTTP request. -
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(String name) Returns the attribute.Returns the conditions.String[]Returns the extra queries.Returns the facet info.Returns the fields.Returns the geo info.Returns the highlight info.String[]Returns the languages.Returns the locale.intReturns theoffsetparameter from the request, defaulting to0when missing or non-numeric.intReturns the requested page size, validated and bounded by the Fess configuration.getQuery()Returns the query.Returns the similar document hash.getSort()Returns the sort.intReturns thestartparameter from the request, defaulting to the configuredpaging.search.page.startwhen missing or malformed.Returns the track total hits.getType()Returns the search request type.Methods inherited from class org.codelibs.fess.entity.SearchRequestParams
createFacetInfo, createGeoInfo, getMinScore, getParamValueArray, getResponseFields, hasConditionQuery, isEmptyArray, simplifyArray
-
Constructor Details
-
V2JsonRequestParams
public V2JsonRequestParams(jakarta.servlet.http.HttpServletRequest request, org.codelibs.fess.mylasta.direction.FessConfig fessConfig) Constructs a v2 request-params adapter over an incoming HTTP request.- Parameters:
request- the incoming HTTP request whose parameters are read on demandfessConfig- the Fess configuration used to source default paging values
-
-
Method Details
-
getTrackTotalHits
Description copied from class:SearchRequestParamsReturns the track total hits.- Overrides:
getTrackTotalHitsin classSearchRequestParams- Returns:
- The track total hits.
-
getQuery
Description copied from class:SearchRequestParamsReturns the query.- Specified by:
getQueryin classSearchRequestParams- Returns:
- The query.
-
getExtraQueries
Description copied from class:SearchRequestParamsReturns the extra queries.- Specified by:
getExtraQueriesin classSearchRequestParams- Returns:
- The extra queries.
-
getFields
Description copied from class:SearchRequestParamsReturns the fields.- Specified by:
getFieldsin classSearchRequestParams- Returns:
- The fields.
-
getConditions
Description copied from class:SearchRequestParamsReturns the conditions.- Specified by:
getConditionsin classSearchRequestParams- Returns:
- The conditions.
-
getLanguages
Description copied from class:SearchRequestParamsReturns the languages.- Specified by:
getLanguagesin classSearchRequestParams- Returns:
- The languages.
-
getGeoInfo
Description copied from class:SearchRequestParamsReturns the geo info.- Specified by:
getGeoInfoin classSearchRequestParams- Returns:
- The geo info.
-
getFacetInfo
Description copied from class:SearchRequestParamsReturns the facet info.- Specified by:
getFacetInfoin classSearchRequestParams- Returns:
- The facet info.
-
getSort
Description copied from class:SearchRequestParamsReturns the sort.- Specified by:
getSortin classSearchRequestParams- Returns:
- The sort.
-
getStartPosition
public int getStartPosition()Returns thestartparameter from the request, defaulting to the configuredpaging.search.page.startwhen missing or malformed.The parsed value is cached after the first call so concurrent paging fields can read it without re-parsing. A negative
startis rejected withV2JsonRequestParams.InvalidOffsetException— historically the-1sentinel meant "uninitialised", which collided with a client legitimately requesting-1; the sentinel is now an explicitstartPositionInitializedflag.- Specified by:
getStartPositionin classSearchRequestParams- Returns:
- the validated, non-negative start position
- Throws:
V2JsonRequestParams.InvalidOffsetException- ifstartis present and< 0
-
getOffset
public int getOffset()Returns theoffsetparameter from the request, defaulting to0when missing or non-numeric.The parsed value is cached after the first call. A negative
offsetis rejected withV2JsonRequestParams.InvalidOffsetException— historically the-1sentinel meant "uninitialised", which collided with a client legitimately passing-1. Caching is now driven by an explicitoffsetInitializedflag.- Specified by:
getOffsetin classSearchRequestParams- Returns:
- the validated, non-negative offset
- Throws:
V2JsonRequestParams.InvalidOffsetException- ifoffsetis present and< 0
-
getPageSize
public int getPageSize()Returns the requested page size, validated and bounded by the Fess configuration.Contract:
- Missing or blank
num: returns the configured default page size. - Non-numeric
num: returns the configured default page size. num <= 0: throwsV2JsonRequestParams.InvalidPageSizeException— zero and negative values are not meaningful and likely indicate a client bug; rejecting them early prevents silent amplification to the configured maximum.num > max: clamps silently to the configured maximum. Clients can detect clamping by comparing the requestnumwith thepage_sizefield returned in the response envelope.1 <= num <= max: returned unchanged.
- Specified by:
getPageSizein classSearchRequestParams- Returns:
- validated page size in the range
[1, configuredMax] - Throws:
V2JsonRequestParams.InvalidPageSizeException- ifnumis present and<= 0
- Missing or blank
-
getAttribute
Description copied from class:SearchRequestParamsReturns the attribute.- Specified by:
getAttributein classSearchRequestParams- Parameters:
name- The name of the attribute.- Returns:
- The attribute.
-
getLocale
Description copied from class:SearchRequestParamsReturns the locale.- Specified by:
getLocalein classSearchRequestParams- Returns:
- The locale.
-
getType
Description copied from class:SearchRequestParamsReturns the search request type.- Specified by:
getTypein classSearchRequestParams- Returns:
- The search request type.
-
getSimilarDocHash
Description copied from class:SearchRequestParamsReturns the similar document hash.- Specified by:
getSimilarDocHashin classSearchRequestParams- Returns:
- The similar document hash.
-
getHighlightInfo
Description copied from class:SearchRequestParamsReturns the highlight info.- Specified by:
getHighlightInfoin classSearchRequestParams- Returns:
- The highlight info.
-