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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDocumentHighLighting(String strDocumentId, String terms) getFacetedSearchResults(String strQuery, String[] fl, String[] facetQueries, String sortName, String sortOrder, int nLimit, int nCurrentPageIndex, int nItemsPerPage, Boolean bSpellCheck) Return the result with facets.getFacetedSearchResults(String strQuery, String[] facetQueries, String sortName, String sortOrder, int nLimit, int nCurrentPageIndex, int nItemsPerPage, Boolean bSpellCheck) Return the result with facets.getGeolocSearchResults(String strQuery, String[] facetQueries, int nLimit) Return the result geojseon and uidstatic SolrSearchEngineReturns the instanceorg.apache.solr.client.solrj.response.QueryResponsegetJsonpSuggest(String terms, String callback) getJsonSearchResults(Map<String, String[]> solrParam) Runs a search against the Solr /select handler and returns the raw JSON response.List<fr.paris.lutece.portal.service.search.SearchResult>getSearchResults(String strQuery, javax.servlet.http.HttpServletRequest request) Return search resultsorg.apache.solr.client.solrj.response.SpellCheckResponsegetSpellChecker(String term) Return the suggestion terms
-
Field Details
-
SOLR_FACET_DATE_GAP
-
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:
getSearchResultsin interfacefr.paris.lutece.portal.service.search.SearchEngine- Parameters:
strQuery- The search queryrequest- The HTTP request- Returns:
- Results as a collection of SearchResult
-
getJsonSearchResults
Runs a search against the Solr /select handler and returns the raw JSON response. Only the parameters accepted byisJsonSearchParameterAllowed(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 queryfacetQueries- The selected facetssortName- The facet name to sort bysortOrder- "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 queryfacetQueries- The selected facetsfl- the list of fieldssortName- The facet name to sort bysortOrder- "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 queryfacetQueries- The selected facetsnLimit- Maximal number of results.- Returns:
- the results geojson and uid
-
getSpellChecker
Return the suggestion terms- Parameters:
term- the terms of search- Returns:
- The spell checker response
-
getJsonpSuggest
-
getDocumentHighLighting
-
getInstance
Returns the instance- Returns:
- the instance
-