I have created Basic search application in Vespa with an implementation of the Searcher class. I have fed these below documents using my application one by one.
{
"fields": {
"album": "Good",
"artist": "Arijit",
"title": "tum ho",
"year": 2017,
"duration": 300
}
}
{
"fields": {
"album": "Good",
"artist": "Atif",
"title": "bewajah",
"year": 2017,
"duration": 300
}
}
{
"fields": {
"album": "bad",
"artist": "Neha",
"title": "tere",
"year": 2017,
"duration": 400
}
}
My Searcher class is below:
public class ExampleSearcher extends Searcher {
@Override
public Result search(Query query, Execution execution) {
retrun execution.search(query);
}
}
Now when I search using the API:
http://localhost:8080/search/?album=good OR http://localhost:8080/search/?=good
I got the result:
{
"root": {
"id": "toplevel",
"relevance": 1,
"fields": {
"totalCount": 0
}
}
}
But I should get this result output:
{
"root": {
"id": "toplevel",
"relevance": 1,
"fields": {
"totalCount": 2
},
"children": [{
"id": "good",
"relevance": 1,
"fields": {
"album": "Good",
"artist": "Arijit",
"title": "tum ho",
"year": 2017,
"duration": 300
}
}, {
"id": "good",
"relevance": 1,
"fields": {
"album": "Good",
"artist": "Atif",
"title": "bewajah",
"year": 2017,
"duration": 300
}
}]
}
}
What am I doing wrong or how should I do it?