0

I'm building a text search with python and Flask-Whooshalchemy, currently I have something like this:

Entry.query.whoosh_search('something').all()

Which goes through body and title of Entry. However, it returns true only if content has that exact string. So for example

Entry.query.whoosh_search('cat').all()

returns entries with "I have a cat" but not "housecat" or "cats".

How can I make the search find strings inside strings?

Demeter
  • 106
  • 1
  • 8
  • Based on the reply [here](https://groups.google.com/forum/#!topic/whoosh/ZvKHCXIB10k) you might want to try `Entry.query.whoosh_search('*cat*').all()` (added *). According the linked reply that should call the `whoosh.query.Wildcard` class in the default `whoosh.qparser.QueryParser` in Whoosh, which I believe WhooshAlchemy makes use of by default. – Seberius Sep 25 '13 at 20:39

1 Answers1

0

try

Entry.query.whoosh_search('*something*').all()

'*' is for zero or more characters.

user3684055
  • 228
  • 3
  • 13