A sample application showcasing a simple e-commerce site built with Vespa. Refer to Use Case - shopping.
Included scripts to convert data from Julian McAuley's Amazon product data set (http://jmcauley.ucsd.edu/data/amazon/links.html) to a Vespa data feed. This repository contains a small sample of this data from the sports and outdoor category, but you can download other data from the site above and use the scripts to convert.
Check-out, compile and run:
$ git clone https://github.com/vespa-engine/sample-apps.git $ VESPA_SAMPLE_APPS=`pwd`/sample-apps $ cd $VESPA_SAMPLE_APPS/use-case-shopping && mvn clean package $ docker run --detach --name vespa --hostname vespa-container --privileged \ --volume $VESPA_SAMPLE_APPS:/vespa-sample-apps --publish 8080:8080 vespaengine/vespa
Wait for the configserver to start:
$ docker exec vespa bash -c 'curl -s --head http://localhost:19071/ApplicationStatus'
Deploy the application:
$ docker exec vespa bash -c '/opt/vespa/bin/vespa-deploy prepare /vespa-sample-apps/use-case-shopping/target/application.zip && \ /opt/vespa/bin/vespa-deploy activate'
Wait for the application to start:
$ curl -s --head http://localhost:8080/ApplicationStatus
Create data feed:
First, create data feed for products:
$ gunzip -c meta_sports_20k_sample.json.gz | ./convert_meta.py > feed_items.json
Next, data feed for reviews:
$ gunzip -c reviews_sports_24k_sample.json.gz | ./convert_reviews.py > feed_reviews.json
Feed data:
Feed products:
$ docker exec vespa bash -c 'java -jar /opt/vespa/lib/jars/vespa-http-client-jar-with-dependencies.jar \ --file /vespa-sample-apps/use-case-shopping/feed_items.json --host localhost --port 8080'
Feed reviews:
$ docker exec vespa bash -c 'java -jar /opt/vespa/lib/jars/vespa-http-client-jar-with-dependencies.jar \ --file /vespa-sample-apps/use-case-shopping/feed_reviews.json --host localhost --port 8080'
Test the application:
$ curl -s http://localhost:8080/search/?query=default:golf
Browse the site:
Shutdown and remove the container:
$ docker rm -f vespa