1

Following the part 6 of the tutorial: https://docs.vespa.ai/en/tutorials/news-6-recommendation-with-searchers.html I produced the mavel-compiled folder and zip file:

(vespa) raphy@pc:~/vespa/sample-apps/news/app-6-recommendation-with-searchers/target$ ls -lah
total 56K
drwxrwxr-x 8 raphy raphy 4.0K Dec 14 16:51 .
drwxrwxr-x 4 raphy raphy 4.0K Dec 14 16:51 ..
drwxrwxr-x 2 raphy raphy 4.0K Dec 14 16:51 antrun
drwxrwxr-x 5 raphy raphy 4.0K Dec 14 16:51 application
-rw-rw-r-- 1 raphy raphy 6.3K Dec 14 16:51 application.zip
drwxrwxr-x 4 raphy raphy 4.0K Dec 14 16:51 classes
drwxrwxr-x 3 raphy raphy 4.0K Dec 14 16:51 generated-sources
drwxrwxr-x 2 raphy raphy 4.0K Dec 14 16:51 maven-archiver
drwxrwxr-x 3 raphy raphy 4.0K Dec 14 16:51 maven-status
-rw-rw-r-- 1 raphy raphy 4.6K Dec 14 16:51 news-recommendation-searcher-0.0.1-deploy.jar
-rw-rw-r-- 1 raphy raphy 4.6K Dec 14 16:51 news-recommendation-searcher-0.0.1-without-dependencies.jar

I tried to deploy it

    (vespa) raphy@pc:~/vespa/sample-apps/news/app-6-recommendation-with-searchers/target$ (cd application && zip -r - .) |
> curl --header Content-Type:application/zip --data-binary @- \
> localhost:19071/application/v2/tenant/default/prepareandactivate
  adding: components/ (stored 0%)
  adding: components/news-recommendation-searcher-0.0.1-deploy.jar (deflated 23%)
  adding: build-meta.json (deflated -1%)
  adding: search/ (stored 0%)
  adding: search/query-profiles/ (stored 0%)
  adding: search/query-profiles/default.xml (deflated 18%)
  adding: search/query-profiles/types/ (stored 0%)
  adding: search/query-profiles/types/root.xml (deflated 24%)
  adding: schemas/ (stored 0%)
  adding: schemas/news.sd (deflated 73%)
  adding: schemas/user.sd (deflated 51%)
  adding: services.xml (deflated 51%)
  adding: hosts.xml (deflated 25%)
{"log":[],"tenant":"default","url":"http://localhost:19071/application/v2/tenant/default/application/default/environment/prod/region/default/instance/default","message":"Session 17 for tenant 'default' prepared and activated.","configChangeActions":{"restart":[],"refeed":[],"reindex":[]}}(vespa) raphy@pc

But when testing I get this error:

/?user_id=U33527&searchchain=user' | python -m json.tool
{
    "root": {
        "id": "toplevel",
        "relevance": 1.0,
        "fields": {
            "totalCount": 0
        },
        "errors": [
            {
                "code": 3,
                "summary": "Illegal query",
                "source": "mind",
                "message": "No query"
            }
        ]
    }
}

Now I'm getting this:

(vespa) raphy@pc:~/vespa/sample-apps/news/app-6-recommendation-with-searchers$ curl -s 'http://localhost:8080/search/?user_id=U33527&searchchain=user' | python -m json.tool
Expecting value: line 1 column 1 (char 0)

What am I missing? How to solve the problem?

Raphael10
  • 2,508
  • 7
  • 22
  • 50
  • 2
    I just checked that part of tutorial, and there is a bug in services.xml of the corresponding sample application (https://github.com/vespa-engine/sample-apps/blob/master/news/app-6-recommendation-with-searchers/src/main/application/services.xml#L9) which does not load the correct bundle. You should see an error in the logs if you run: `docker exec vespa bash -c '/opt/vespa/bin/vespa-logfmt -N` Could you check that your services.xml has the line `` ? – Lester Solbakken Dec 15 '21 at 10:20
  • @LesterSolbakken I modified the `services.xml` line to `` . It did not contain `-searcher` . Should I now `maven` compile again? – Raphael10 Dec 15 '21 at 10:29
  • 1
    Yes, `mvn clean package` and redeploy. – Lester Solbakken Dec 15 '21 at 10:29
  • Now it works fine. Thank you @LesterSolbakken !!! – Raphael10 Dec 15 '21 at 10:34

0 Answers0