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

When using cjk analyzer with output_unigram, an unigram before Japanese punctuation is not indexed #1724

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

kaakaa
Copy link
Contributor

@kaakaa kaakaa commented Aug 24, 2022

Summary

When I do indexing and searching Japanese text with cjk analyzer with output_unigram config, the word before Japanese punctuation characters (e.g.: ,) cannot be searched. For example, I got no results with the search query ちは from sentence of こんにちは、世界, but I got a result with the search query ちは from sentence of こんにちは世界.

I look into this, and I found that CJKBigramFilter doesn't flush unigram before punctuations correctly. This PR fixed it.


Sample code to reproduce this issue is here:
https://gist.github.com/kaakaa/ca8c20821ef610b098851f487eb61ea5

@abhinavdangeti
Copy link
Member

Thanks for this contribution @kaakaa .
Let's wait for at least one more review from the team.

@abhinavdangeti abhinavdangeti merged commit 5728b8a into blevesearch:master Dec 1, 2022
@kaakaa kaakaa deleted the fix-cjk branch December 16, 2022 14:15
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

Successfully merging this pull request may close these issues.

2 participants