ontoportal-lirmm / ontologies_linked_data

Models and serializers for ontologies and related artifacts backed by 4store
Other
0 stars 6 forks source link

Feature: Support multilangual search #94

Closed syphax-bouazzouni closed 1 year ago

syphax-bouazzouni commented 1 year ago

Context

This PR update and implement the multi-lingual search. With it, we can now for these three properties of Classes/Concepts: prefLabel, synonym, and definition.

  1. Search in all languages.
  2. Search specifically in one language (e.g. fr, en, ...).
  3. Search specifically in values with no language.

This was made possible by doing two main things;

  1. Update our SOLR Schema to have dynamic fields: to save all the values in different languages. For example, a resource that has labels in French, English and not tagged, we will have in SOLR the fields prefLabel_fr for those in French, prefLabel_en for those in English, prefLabel_none for those with no languages, and lastly prefLabel for all the values in all languages mixed see https://github.com/ontoportal-lirmm/ontologies_linked_data/pull/94/commits/0c4ba8c086d56ec653a3b4a83ef281dc7a6cfc6e).

    Those dynamic fields will let us do requests like this .search(prefLabel_fr:Plante) to search only the label in French. And .search(prefLabel:Plante) to search in all the languages.

  2. Requesting and indexing all the languages: The work done in https://github.com/ontoportal-lirmm/ontologies_linked_data/pull/93 let us fetch all the data in all the languages when we ask for it. Those requested data can then be indexed and saved in their corresponding language dynamic field. ( dynamic fields are created only if values exist in that language, creating only the fields needed) (https://github.com/ontoportal-lirmm/ontologies_linked_data/pull/94/commits/7aaf942f200c2a9b649cf61813e16bcd883ac225)

Changes

syphax-bouazzouni commented 1 year ago

This PR to work in the server we need to update the server SOLR schema.xml file that is in this path /srv/ontoportal/data/solr/config/term_search