Search the end of the word

72 views
Skip to first unread message

Franko I

unread,
Apr 13, 2017, 10:21:52 AM4/13/17
to django-watson discussion group
  Hi,
I like django-watson, if works fine and fast.

Still, I have strings in database as:
`KLM123`
`LL123`
Giving the word for search as `KLM` or `LL`, it returns back desired result. If I put  only `123` it returns nothing (no result to display).
It works only when the beginning of the word (string) is given.
One column is VARCHAR, another is LONGTEXT, results are the same.

I can't find in documentation how could I change that?
Any help is welcome.

Regards,
Franko

Dave Hall

unread,
Apr 18, 2017, 4:36:23 AM4/18/17
to django-watson discussion group
Unfortunately, you can't. Most full text search engines only support whole-word or word-prefix matching. Until this feature is added to database engines, django-watson cannot support it.

--
You received this message because you are subscribed to the Google Groups "django-watson discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-watso...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-watson.
For more options, visit https://groups.google.com/d/optout.

Franko I

unread,
Apr 18, 2017, 8:49:47 AM4/18/17
to django-watson discussion group
Thanks for answer, I thought that some method that is using __icontains could work or override part of the process, something as:
Table_name.objects.get(column_name__icontains='123')

Because from the shell or django, this simple search gives proper result. (Of course, then results shall be additionally parsed if we're not using  this search app.)

Dave Hall

unread,
Apr 19, 2017, 6:42:01 AM4/19/17
to django-watson discussion group
The trouble with icontains is that it is really slow, and isn't language-aware like a full text search engine.

Django-Watson uses the native database full text search implementation, which should scale to huge data sets, but comes with the prefix-only restriction.
Reply all
Reply to author
Forward
0 new messages