No scores returned?
Closed this issue · 1 comments
The docs say explicitly that my response should contain 3 items:
"These search methods return a Map containing 3 entries:
a total entry, representing the total number of hits found
a searchResults entry, containing the hits
a scores entry, containing the hits scores"
But in my case, I never get the scores back when using the simple search. Am I missing something or is something broken?
I was too impatient. For those with the same problem, the docs are a little light on the parameters that are available for querying.
A look at the source for the search method yielded:
def search(SearchRequest request, Map params) {
Ah ha! so I have to pass params.
def res = Vehicle.search("${params.q}", [score:true])
Works as expected!