Version 1.4.0
Update Notice
The setCustomParams function introduced in 1.3.0 now supports multiple parameters with identical keys. Calling the function multiple times with different parameters will also cause the parameters set in the previous call to be overwritten. An example
const fsss = new SmartSearch(host, preparedSearch)
//the following call is now possible
fsss.setCustomParams({fq: "some filter query"}, {fq: "another filter query"})
//another call overwrites the previous one
fsss.setCustomParams({fq: "a new filter query"})
Version 1.3.0
Update Notice
There is a new method to set custom parameters. For example if you want to sort by date, once you have an initial search result that you want to filter, you can set the parameters that will be used for filtering and pagination in subsequent requests.
const fsss = new SmartSearch(host, preparedSearch)
//...
const startDate = //your starting date
const endDate = //your ending date
fsss.setCustomParams({sortDate: "desc"}, {fq:`sort_date:[${startDate.toISOString()} TO ${endDate.toISOString()}]`})
const filteredPage = await facet.filter(...facetValues) //this uses the date filter parameter now
filteredPage.getNext() //this uses the date filter parameter now
fsss.deleteCustomParams("fq") //this deletes the fq parameter
Please also refer to the entry for version 1.2.0 === New features
ID | Description |
---|---|
HPJS-57 |
Added a customFilter function to the facet class, which allows the use of custom parameters for filtering |
Version 1.2.0
Update Notice
Filtering by date is currently not supported by facets, so in this version we added the possibility to include custom parameters when filtering. To enable filtering by date, this function must be combined with a Groovy script at the Prepared Search.
For example, the following script can be used to sort all documents by date:
import org.apache.solr.client.solrj.SolrQuery
// Getting a parameter (sortDate) out of the request
def sortDateParam = parameter.get("sortDate")?.get(0)
// Set the sort order, depending on the given value asc/desc
if (sortDateParam?.equals("asc")) {
solrQuery.addSort("sort_date", SolrQuery.ORDER.asc)
} else if (sortDateParam?.equals("desc")) {
solrQuery.addSort("sort_date", SolrQuery.ORDER.desc)
}
Note that you need a field named "sort_date" in your documents (e.g. added by a groovy). With the new function, the required parameters can then be added as follows:
const startDate = //your starting date as a javascript date object
const endDate = //your ending date as a javascript date object
const filteredPage = await facet.customFilter(facetValues, {sortDate: "desc"}, {fq:`sort_date:[${startDate.toISOString()} TO ${endDate.toISOString()}]`})
Version 1.0.0
New features
ID | Description |
---|---|
HPJS-18 |
Renamed haupia.js to SmartSearch.js. |
HPJS-46 |
Added error message when custom parameters passed to the SmartSearch constructor are not in an Array. |
HPJS-41 |
Added SmartSearch.version function that will return the current version of the library. |
HPJS-17 |
Added examples to the documentation for handling missing fields. |
Version 0.7.0
Update Notice
The README.md file now contains examples for the most common use cases. It should be the first point of reference to get started with developing a search result page using haupia.js. It is also the entry point for the api documentation, which can be found here.
New features
ID | Description |
---|---|
HPJS-11 |
Added a didYouMean render function to the PageRenderer class. |
HPJS-11 |
Custom HTML templates can now be defined in the PageRenderer class. |
HPJS-33 |
Changed the default API endpoint to match the API-gateway path. |
HPJS-37 |
Custom parameters can now be added to all requests. |
HPJS-29 |
Added release notes. |
11. Help
The Technical Support of the e-Spirit AG provides expert technical support covering any topic related to the FirstSpiritâ„¢ product. You can get and find more help concerning relevant topics in our community.
12. Disclaimer
This document is provided for information purposes only. e-Spirit may change the contents hereof without notice. This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. e-Spirit specifically disclaims any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. The technologies, functionality, services, and processes described herein are subject to change without notice.