bookieio / Bookie

Python based delicious.com replacement
GNU Affero General Public License v3.0
633 stars 139 forks source link

Search works "Match Whole Word Only" #444

Open ghost opened 10 years ago

ghost commented 10 years ago

Hi,

I have bookmarked https://bmark.us. So the title Bookie is saved in database. When I use search with "Book" keyword, no result is returned. If I use "Bookie" as keyword, I have the results.

I did not look up source code yet but is this an expected functionality? If it is, is there any way to modify search functionality?

Cheers

ghost commented 10 years ago

Any feedback on this please?

mitechie commented 10 years ago

Sorry for the delay. Yes, this is the currently expected functionality. The fulltext search can be setup to do some root work analysis, but it's not going to know Book as a root for Bookie as it would something like search for searching.

This can be changed by changing how the text is indexed in Bookie. The file here defines a schema for Whoosh to tell it what type of data to index and how to index it:

https://github.com/bookieio/Bookie/blob/develop/bookie/models/fulltext.py#L51

We'd have to look into doing some ngram indexing to support your query.

http://pythonhosted.org/Whoosh/ngrams.html