Skip to content

Latest commit

 

History

History
 
 

blog-recommendation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Vespa sample applications - blog recommendation tutorial

This sample application contains the code for the blog recommendation tutorial. Refer to Vespa tutorial pt.2 - Blog recommendation.

Executable example

Validate environment, should be 10G:

$ docker info | grep "Total Memory"

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/blog-recommendation && 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/blog-recommendation/target/application.zip && \
  /opt/vespa/bin/vespa-deploy activate'

Wait for the application to start:

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

Test the application:

$ curl 'http://localhost:8080/search/?user_id=0&searchChain=user&query=sddocname:blog_post'

Shutdown and remove the container:

$ docker rm -f vespa