Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whoosh <Hit{}> Issue

I'm working through the Whoosh Quick start guide, and everything seems to be working except that I can't quite replicate the results in the guide.

I'm up to the bit about the Searcher object and when I run the code

print(results[0])

I don't get back an actual result if a match is found, I simply get back

<Hit {}>

whereas in the tutorial, the output is

{"title": "Second try", "path": "/b", "icon": "/icons/sheep.png"}

which is obviously quite a bit more helpful!

Any idea what I might be doing wrong?

like image 276
Jonathan Avatar asked Jan 25 '26 12:01

Jonathan


1 Answers

Figured it out.

For those who run into the same problem, I messed up by not explicitly stating that any of the items in my schema were stored - i.e. (stored=True).

like image 137
Jonathan Avatar answered Jan 28 '26 00:01

Jonathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!