Class SolrSearchEngine

java.lang.Object
fr.paris.lutece.plugins.search.solr.business.SolrSearchEngine
All Implemented Interfaces:
fr.paris.lutece.portal.service.search.SearchEngine

public class SolrSearchEngine extends Object implements fr.paris.lutece.portal.service.search.SearchEngine
SolrSearchEngine
  • Field Details

    • SOLR_FACET_DATE_GAP

      public static final String SOLR_FACET_DATE_GAP
    • SOLR_FACET_DATE_END

      public static final String SOLR_FACET_DATE_END
    • SOLR_FACET_LIMIT

      public static final int SOLR_FACET_LIMIT
  • Constructor Details

    • SolrSearchEngine

      public SolrSearchEngine()
  • Method Details

    • getSearchResults

      public List<fr.paris.lutece.portal.service.search.SearchResult> getSearchResults(String strQuery, javax.servlet.http.HttpServletRequest request)
      Return search results
      Specified by:
      getSearchResults in interface fr.paris.lutece.portal.service.search.SearchEngine
      Parameters:
      strQuery - The search query
      request - The HTTP request
      Returns:
      Results as a collection of SearchResult
    • getJsonSearchResults

      public String getJsonSearchResults(Map<String,String[]> solrParam)
      Runs a search against the Solr /select handler and returns the raw JSON response. Only the parameters accepted by isJsonSearchParameterAllowed(String) are forwarded to Solr, and the request handler is forced to "/select". This prevents an attacker from hijacking the request handler (for instance through the "qt" parameter and path traversal) to reach the administrative or CoreAdmin endpoints of the Solr backend.
      Parameters:
      solrParam - the HTTP parameters of the incoming request
      Returns:
      the raw JSON response returned by Solr, or an empty string on error
    • getFacetedSearchResults

      public SolrFacetedResult getFacetedSearchResults(String strQuery, String[] facetQueries, String sortName, String sortOrder, int nLimit, int nCurrentPageIndex, int nItemsPerPage, Boolean bSpellCheck)
      Return the result with facets. Does NOT support authentification yet.
      Parameters:
      strQuery - the query
      facetQueries - The selected facets
      sortName - The facet name to sort by
      sortOrder - "asc" or "desc"
      nLimit - Maximal number of results.
      Returns:
      the result with facets
    • getFacetedSearchResults

      public SolrFacetedResult getFacetedSearchResults(String strQuery, String[] fl, String[] facetQueries, String sortName, String sortOrder, int nLimit, int nCurrentPageIndex, int nItemsPerPage, Boolean bSpellCheck)
      Return the result with facets. Does NOT support authentification yet.
      Parameters:
      strQuery - the query
      facetQueries - The selected facets
      fl - the list of fields
      sortName - The facet name to sort by
      sortOrder - "asc" or "desc"
      nLimit - Maximal number of results.
      Returns:
      the result with facets
    • getGeolocSearchResults

      public List<SolrSearchResult> getGeolocSearchResults(String strQuery, String[] facetQueries, int nLimit)
      Return the result geojseon and uid
      Parameters:
      strQuery - the query
      facetQueries - The selected facets
      nLimit - Maximal number of results.
      Returns:
      the results geojson and uid
    • getSpellChecker

      public org.apache.solr.client.solrj.response.SpellCheckResponse getSpellChecker(String term)
      Return the suggestion terms
      Parameters:
      term - the terms of search
      Returns:
      The spell checker response
    • getJsonpSuggest

      public org.apache.solr.client.solrj.response.QueryResponse getJsonpSuggest(String terms, String callback)
    • getDocumentHighLighting

      public String getDocumentHighLighting(String strDocumentId, String terms)
    • getInstance

      public static SolrSearchEngine getInstance()
      Returns the instance
      Returns:
      the instance