Class DefaultSearcher

java.lang.Object
org.codelibs.fess.rank.fusion.RankFusionSearcher
org.codelibs.fess.rank.fusion.DefaultSearcher

public class DefaultSearcher extends RankFusionSearcher
Default implementation of RankFusionSearcher that performs standard OpenSearch queries. This searcher handles query execution, response processing, and document highlighting.
  • Field Summary

    Fields inherited from class org.codelibs.fess.rank.fusion.RankFusionSearcher

    name
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new instance of DefaultSearcher.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder>
    createSearchCondition(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
    Creates a search condition for the OpenSearch request.
    protected Map<String,Object>
    parseSearchHit(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String hlPrefix, org.opensearch.search.SearchHit searchHit)
    Parses a search hit from OpenSearch and converts it to a document map.
    protected SearchResult
    processResponse(org.dbflute.optional.OptionalEntity<org.opensearch.action.search.SearchResponse> searchResponseOpt)
    Processes the OpenSearch response and converts it to a SearchResult.
    protected SearchResult
    search(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
    Performs a search operation using the specified query and parameters.
    protected org.dbflute.optional.OptionalEntity<org.opensearch.action.search.SearchResponse>
    sendRequest(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
    Sends a search request to OpenSearch with the specified parameters.

    Methods inherited from class org.codelibs.fess.rank.fusion.RankFusionSearcher

    getName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultSearcher

      public DefaultSearcher()
      Creates a new instance of DefaultSearcher. This constructor initializes the default rank fusion searcher for performing standard OpenSearch queries with response processing and document highlighting.
  • Method Details

    • search

      protected SearchResult search(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
      Performs a search operation using the specified query and parameters.
      Specified by:
      search in class RankFusionSearcher
      Parameters:
      query - the search query string
      params - the search request parameters
      userBean - the optional user bean for access control
      Returns:
      the search result containing documents and metadata
    • processResponse

      protected SearchResult processResponse(org.dbflute.optional.OptionalEntity<org.opensearch.action.search.SearchResponse> searchResponseOpt)
      Processes the OpenSearch response and converts it to a SearchResult.
      Parameters:
      searchResponseOpt - the optional search response from OpenSearch
      Returns:
      the processed search result
    • sendRequest

      protected org.dbflute.optional.OptionalEntity<org.opensearch.action.search.SearchResponse> sendRequest(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
      Sends a search request to OpenSearch with the specified parameters.
      Parameters:
      query - the search query string
      params - the search request parameters
      userBean - the optional user bean for access control
      Returns:
      the optional search response from OpenSearch
    • createSearchCondition

      protected SearchEngineClient.SearchCondition<org.opensearch.action.search.SearchRequestBuilder> createSearchCondition(String query, SearchRequestParams params, org.dbflute.optional.OptionalThing<org.codelibs.fess.mylasta.action.FessUserBean> userBean)
      Creates a search condition for the OpenSearch request.
      Parameters:
      query - the search query string
      params - the search request parameters
      userBean - the optional user bean for access control
      Returns:
      the search condition for the request
    • parseSearchHit

      protected Map<String,Object> parseSearchHit(org.codelibs.fess.mylasta.direction.FessConfig fessConfig, String hlPrefix, org.opensearch.search.SearchHit searchHit)
      Parses a search hit from OpenSearch and converts it to a document map.
      Parameters:
      fessConfig - the Fess configuration
      hlPrefix - the highlight prefix for field names
      searchHit - the search hit to parse
      Returns:
      the parsed document as a map