etianen / django-watson

Full-text multi-table search application for Django. Easy to install and use, with good performance.
BSD 3-Clause "New" or "Revised" License
1.2k stars 130 forks source link

An "s" character at the end of a word #256

Closed roodie closed 4 years ago

roodie commented 5 years ago

Interesting problem, I am using the PostgreSQL backend, with the following locale:

WATSON_BACKEND = 'watson.backends.PostgresSearchBackend'
WATSON_POSTGRES_SEARCH_CONFIG = "pg_catalog.hungarian"

One of the fields contains my family name, which is "Farkas". Now for some reason in the index it gets truncated to 'farka'.

Example:

'farka':8 'istvan':7 'document':9

Now if I use watson.filter() to look for my family name, there are no results.

I guess the problem is that initially I forgot to set the correct locale when I used 'installwatson' and the trigger is set to pg_catalog.english. Tried to use 'manage.py uninstallwatson' then reinstall it, but this failed. I was able to correct the functionality by deleting the table and migration and remigrating watson. Probably worths a note in the docs.

etianen commented 5 years ago

I suspect that ./manage.py migrate watson zero followed by ./manage.py migrate watson would acheive the same effect for changing the postgres search config. Can you confirm?

On Sun, 14 Jul 2019 at 13:07, roodie notifications@github.com wrote:

Interesting problem, I am using the PostgreSQL backend, with the following locale:

WATSON_BACKEND = 'watson.backends.PostgresSearchBackend'WATSON_POSTGRES_SEARCH_CONFIG = "pg_catalog.hungarian"

One of the fields contains my family name, which is "Farkas". Now for some reason in the index it gets truncated to 'farka'.

Example:

'farka':8 'istvan':7 'document':9

Now if I use watson.filter() to look for my family name, there are no results.

I guess the problem is that initially I forgot to set the correct locale when I used 'installwatson' and the trigger is set to pg_catalog.english. Tried to use 'manage.py uninstallwatson' then reinstall it, but this failed. I was able to correct the functionality by deleting the table and migration and remigrating watson. Probably worths a note in the docs.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/256?email_source=notifications&email_token=AABEKCASE7QH7XHGDH37W33P7MJIZA5CNFSM4IDN5WG2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G7CP5ZA, or mute the thread https://github.com/notifications/unsubscribe-auth/AABEKCDPIQLHGPKVOUZXQOLP7MJIZANCNFSM4IDN5WGQ .

roodie commented 5 years ago

Yes, the "I was able to correct the functionality by deleting the table and migration and remigrating watson" part means exactly that, sorry for the vague wording :-)

etianen commented 5 years ago

Great! I've added a note at the bottom of the wiki page:

https://github.com/etianen/django-watson/wiki/Language-support

On Mon, 22 Jul 2019 at 08:21, roodie notifications@github.com wrote:

Yes, the "I was able to correct the functionality by deleting the table and migration and remigrating watson" part means exatly that, sorry for the vague wording :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/etianen/django-watson/issues/256?email_source=notifications&email_token=AABEKCGZYVXO7D2NXRXA3Q3QAVNUZA5CNFSM4IDN5WG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2PAGFQ#issuecomment-513671958, or mute the thread https://github.com/notifications/unsubscribe-auth/AABEKCFG76HFHRNXCLIFSDTQAVNUZANCNFSM4IDN5WGQ .