Skip to content

Latest commit

 

History

History

search-engine-app

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

AUSNEWS search engine

This vespa application is the search application and engine of the ausnews search project.

This application deploys the search engine and application to GKE and is used in combination with the crawler and feeder.

To develop locally, clone and checkout the docker branch as below:

Executable example:

$ git clone https://github.com/ausnews/search-engine-app.git
$ git checkout docker
$ NEWS_APP=`pwd`/search-engine-app
$ cd $NEWS_APP && mvn clean package
$ docker run --detach --name vespa --hostname vespa-container --privileged \
  --volume $NEWS_APP:/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 /apps/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:

To fetch some content, clone the crawler, follow setup instructions and run the code in bin/abc-sample.sh. This will create a number of ABC news articles you can feed to the engine.

$ git clone https://github.com/ausnews/search-engine-app.git
$ ./bin/abc-sample.sh
$ cp vespa.json $NEWS_APP/

Feed data:

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

Test the application:

$ curl -s 'http://localhost:8080/search/?query=what+is+dad+bod'

Browse the site:

http://localhost:8080/site

Shutdown and remove the container:

$ docker rm -f vespa