glossary search with solr ?

glossary search with solr ?

by Philipp Streit -
Number of replies: 4

Hi,

is it true that there is no chance of using Solr-Searchengine as the glossary search function? Solr seems to be only working as "global search" from the dashboard but not as glossary search.

The aim would be that the glossary seach finds even glossary-entrys if the searched-for word is found in an attached document (attached from nextcloud repository) 

we do have Moodle 3.11 but will migrate to Moodle 4.0 soon.

If you have any ideas how to make that functionality  work I would be really grateful.

If there is no native functionality for this: how much would it be to let this be programmed by a professional?


kind regards

Phil

Average of ratings: -
In reply to Philipp Streit

Re: glossary search with solr ?

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers
Solr searches Glossary entries, according to the Global search documentation. I tested it on my Moodle 3.9 site and it does indeed work. Check your Site administration > Plugins > Search > Search areas page to make sure that searching Glossary entries is enabled (see screenshot below).
Regarding files attached to a glossary entry, it seems that if you attach it rather than link it, the file will be copied from Nextcloud to the Moodle server, and it should then be indexed by Solr too.


Average of ratings: Useful (2)
In reply to Eoin Campbell

Re: glossary search with solr ?

by Philipp Streit -
Hey Eoin,

thank you very much for your answer! I think I might have expressed myself misleadingly

1)

It is indeed true that GlobalSearch uses Solr succesfully to find Glossary entries. But for doing so the User needs to use "Global Search" and NOT the "Glossary search" field in the Glossary-activity. This can be very confusing since the position of the Glossary-Search right under the Title suggests that this is the field to use if you want to search the Glossary....

To make myself clear i made a screenshot: 



Is there any way to replace the glossary-search (red) with the global-search function (green) ?
Or can I at least somehow hide the misleading and irritating glossary-search-field so  that the user goes the "correct" path and uses the global search field instead?


2)

Unfortunately my usecase requires to "link" the documents from nextcloud and not attach it. The reason is that I want to link a huge chunk of documents to many different glossaries and in case one of the documents gets updated in the repository (nextcloud) all "linked" documents (that means all glossary-linked-documents) should be updated immediately. So I would somehow need the Repository Plugin to index the "linked" documents as well.

Since my non-profit association is now just starting to implement Moodle I wonder if these urgend-needed funcitonalities described above are "very hard" or "impossible" to realize from a developers perspective? Since you Eoin are a Plugin-developer-yourself: what do you think? Can i forget it? Might there be any chance to get these "features" into the global Moodle-Development-Pipeline? Or might it be worth to look for a developer to let them be individually developed for our needs? Maybe I could organize some money for that purpose but I would need a raw notion of how elaborate and costly the development of such features might become?

Thank you for your help!

kind regards
Philipp
In reply to Philipp Streit

Re: glossary search with solr ?

by Eoin Campbell -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

1. Hiding the default Glossary search: You could hide the standard search box quite easily, either by using CSS to hide it, or editing the PHP code to remove it.

2. Using Solr to search the Glossary: you could use a Generico filter to configure a glossary-specific search that used Solr to search the glossary in this course only (see this related post: https://moodle.org/mod/forum/discuss.php?d=434583#p1748773).

3. Using Solr to search linked files on NextCloud: this is probably very hard, and would require a lot of custom development. You should first check whether or not Solr actually indexes linked files on Nextcloud or not. Perhaps it all just works already! If not, then as an alternative, you could instead use Nextcloud, which seems to have its own search facilities, see https://apps.nextcloud.com/categories/search. You could probably integrate the Nextcloud search facility into Moodle somehow, and use it to search the glossary in some way. If you host your own Nextcloud instance, then perhaps you could get Solr to index it and use it within Moodle. You would need to get some advice on this from the Nextcloud people.

Average of ratings: Useful (1)
In reply to Philipp Streit

Re: glossary search with solr ?

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi Phillip,

The menu which provides the search box uses a template (mod/glossary/templates/standard_action_menu.mustache) to create the available items which is good news. Templates can be easily edited by some who understand HTML well without other coding experience. The revised template can be placed in the theme where it will override the core template making upgrades more easy. The existing search there could be replaced with a HTML form that directs to global search instead of the glossary. An experienced developer should take a couple hours to do this with proper testing.