-
Dear CollectionBuilder Team Members, I hope you all had a great summer and that the semester is off to a good start! I spent a lot of the summer polishing/expanding the metadata for the site we had corresponded about previously in the Q&A discussion board in June. The late stages of the development process are going well but I recently noticed an issue where there aren't any search results appearing for alternative alphabet queries. I'm finding that the Fuzzy Search via Lunr.js currently only supports Latin alphabet searches, however, my metadata has entries that contain words in Hebrew, Arabic, and Greek. I found the Lunr page on "Language support" mods but of those three, only Arabic script is supported. How would you recommend I go about altering the Lunr code to support all three alternative alphabets? [https://lunr.readthedocs.io/en/v0.5.0/languages/] |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Good question @geniza ! First, quick fix to get it working (based on a solution in an Issue in Lunr.js):
Second, if you want to go further and add real language support to the processing pipeline, you can use the "lunr-languages" plugin. The Lunr docs only cover doing it if you are using npm to set up your javascript, and use a different style of writing js functions--so there is some additional steps to adapt it to CollectionBuilder's set up. I will give it a try myself and post an example soon! |
Beta Was this translation helpful? Give feedback.
Good question @geniza !
I want to clarify that the link you have above is to a python version of Lunr that can do some more complicated things--CollectionBuilder is using Lunr.js so be sure to look for docs specifically related to it.
There is a couple of things you can do.
First, quick fix to get it working (based on a solution in an Issue in Lunr.js):
//this.pipeline.remove(lunr.trimmer)
, on a new line below that, add the codethis.pipeline.reset()
. Save the file. This will just remove the english specific processing, so that all the characters will be indexed …