Plugin for Solr Suggester Component

Hi folks,
I created a plugin for Solr (version 6.3) that adds a permission layer to filter the retrieved documents using a database query (e.g: the user with ID 2 hasn’t permissions to see the document with the ID 1); As the logic that defines if a user has permissions needs fields that aren’t indexed in the Solr, I need to check in the database.

To achieve that i created a Query Parser (called DocumentsByUserParser that extends the class QParserPlugin) defined in the solrconfig.xml with the following:

To call this plugin, i only have to set the fq parameter with the {!filterDocument userId=’<user_id>’} along with the other query parameters. Note that the code above works well with the Search Component with an edismax type.

My question is: can i create a new similar plugin, as described above, that works with the Suggest Component? Because when I index a document, the user may have (or not) permissions to see that document, so the suggester shouldn’t show suggestions that the user hasn’t permissions to see.

I defined my Suggest Component along with the Request Handler with the following:


P.S - The context filter query described in only works with a single indexed field, so this will not work with my use case.

(Tagging @lilients, who may be interested!)

Hi @leviya m

As part of the optimization of external search support for OJS, the PKP Technical Committee is looking for use cases and relevant experience with the Lucene/Solr plugin for OJS.

GitHub - ojsde/lucene: Plugin for Solr/Lucene support in OJS. or via Plugin-Gallery

We are going to organize a meeting with all the interested parties. If you are interested in sharing requirements, user experiences and use cases, please feel free to contact me.

Dulip Withanage