Solr query function that retrieve price (float value) according to current / entered unix timestamp.
Function expects data in the following format:
date_from|price[ date_from|price ...]
In example:
1483228800|100.00 1483239600|63.30 1483272000|100.00
-
Compile project:
mvn clean install
-
Copy generated jar file to Solr
contrib
folder:cp target/solr-timestampprice-*.jar <SOLR_INSTALL_DIR>/contrib
-
Add definition in
solrconfig.xml
file:<lib dir="${solr.install.dir:../../../..}/contrib" regex="solr\-timestampprice\-.+\.jar" /> <valueSourceParser name="timestamp_price" class="net.gilek.solr.timestampprice.TimestampPriceValueSourceParser" />
timestamp_price(source[, timestamp])
Function accepts the following parameters:
Parameter | Required | Description |
---|---|---|
source | yes | Source value. It can be name of the field or string type value (in quotation marks). |
timestamp | no | Unix timestamp. If empty (default) actual time will be used. |