-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix post filter for lang codes with a dash (zh-hans) #20
Conversation
Added `keyword` for `post_lang` in order to fix filtering by "zh-hans".
Hi there, @Dehax Thanks for the feedback, and the time you took to craft this pull request. I am glad to inform you that we have this already solved in #13 (and an extra, small refinement is on its way). We will be having a new release for this plugin relatively soon, including this fix among other changes from recent pull requests, and some other surprises. If you do not mind, I am closing this as the defect fixed here was already fixed in the link above. Thanks again! |
Hi @decodekult , I'm using the newest version from |
Hi @Dehax I have checked this deeply, and you are right! The change mentioned above just included a new analyzer for the language field, but it still uses a standard tokenizer, which splits content by dashes. In addition, another related commit about including support for posts set to display as translated when a translation is missing also introduced some unwanted outcome. I will be submitting a pull request addressing both things later today or early tomorrow. In any case, we are playing with alternatives for #6 that will probably result in not having, or not needing, a language field. I will update here once I am done. Thanks a lot! |
Hi @decodekult , Thanks for the update!
|
Oh well, I just merged the change. I think it opens the issue again. Sorry for the back-and-forth. |
This one should fix the problem for good: #25 Thanks for your patience. |
Great indeed! Thanks a lot. |
Added
keyword
forpost_lang
in order to fix filtering by "zh-hans".Language codes with dashes give multiple tokens when analyzed:
And this filter always gives 0 results:
So in order to fix the post filtering issue for such language codes we need to either use additional "keyword" field with "keyword" data type or use "keyword" analyzer for
post_lang
field or just mappost_lang
field to "keyword" data type.