Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird words in index #166

Closed
janroz opened this issue Sep 5, 2018 · 3 comments
Closed

Weird words in index #166

janroz opened this issue Sep 5, 2018 · 3 comments

Comments

@janroz
Copy link

janroz commented Sep 5, 2018

Hello,

we have some issue with search in Czech language. We have characters like ěščřžýáíéěůú etc., and some words cannot be found.

Today I have some free time to look deeper on tntsearch and I see some weird words in our index.

For example - on web (in database) we have word "ergonomicky" but in search index there is "ergonomicki". Look at picture. There are more changes "y" => "i"

I can help with some issues.

issue-tnt

@nticaric
Copy link
Contributor

nticaric commented Sep 5, 2018

The weird words that you're experiencing are called stems, take a look here

@nticaric
Copy link
Contributor

nticaric commented Sep 5, 2018

I think the solution to your problem would be to write a custom tokenizer that would replace

ěščřžýáíéěůú to escrzyaieeuu

@janroz
Copy link
Author

janroz commented Sep 5, 2018

I know what stems are, I have not Czech stemmer (yet). Stemming is off now. However, stem for word "ergonomiky" is not "ergonomicki" but "ergonomick".

I made custom tokenizer:

  • replace special chars to ascii (č => c, ď => d etc.)
  • replace special symbols ($#@*{ etc.)
  • strip tags
  • translate entities back to chars (í => í)

The problem was solved in this way.

Now it looks very good, works like a charm. I think relevance is better also.

@janroz janroz closed this as completed Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants