Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
src/main/application
README.md
blog-sample-data.json

README.md

Vespa sample applications - blog search tutorial

This sample application contains the code for the blog search tutorial.

Please refer to Vespa tutorial pt.1 - Blog searching for more information.

Executable example:

$ git clone https://github.com/vespa-engine/sample-apps.git
$ export VESPA_SAMPLE_APPS=`pwd`/sample-apps
$ docker run -m 10G --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/blog-search/src/main/application && \
  /opt/vespa/bin/vespa-deploy activate'

Wait for the application to start:

$ curl -s --head http://localhost:8080/ApplicationStatus

Feed data into application:

$ docker exec vespa bash -c 'java -jar /opt/vespa/lib/jars/vespa-http-client-jar-with-dependencies.jar --verbose \
  --file /vespa-sample-apps/blog-search/blog-sample-data.json --host localhost --port 8080'

Test the application:

$ curl -s 'http://localhost:8080/search/?query=music' | python -m json.tool

Shutdown and remove the container:

$ docker rm -f vespa