EBISPOT / ols4

Version 4 of the EMBL-EBI Ontology Lookup Service (OLS)
http://www.ebi.ac.uk/ols4/
Apache License 2.0
47 stars 22 forks source link

Search & Select API is not working if indexed ontologies doesn't have at least one synonym #760

Closed rombaum closed 2 weeks ago

rombaum commented 1 month ago

Describe the bug If indexed ontologies doesn't have at least one synonym the search and the select API delivers a Whitelabel Error Page.

To Reproduce Steps to reproduce the behavior:

  1. Index the attached example file with the attached json config
  2. Click on 'http://localhost:8080/api/select?q=' or 'http://localhost:8080/api/search?q='
  3. See Whitelabel Error Page

Expected behavior Synonyms should not be mandatory for a select or search API call.

Screenshots Error 500 select API: grafik Error 500 search API: grafik Error from the log: grafik

Error Message The log provides a hint what the issue is. ols4-ols4-solr-1 | 2024-10-10 14:22:24.513 ERROR (qtp1394940518-25) [ x:ols4_entities] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: org.apache.solr.search.SyntaxError: Query Field 'synonym' is not a valid field name

Upload minimal complete example Config file: file-without-synonym.json Owl file without synonym: file-without-synonym.zip Owl file with synonym: file-with-synonym.zip

Additional context I also indexed a second file without a synonym and the error still appears. When I add one synonym to a file the select and the search API is working as expected.

haideriqbal commented 1 month ago

further investigating the issue @rombaum i believe the issue is because of a assumption in Select and Search controllers. In OLS world we assume that our solr documents have the following fields available {"label", "synonym", "short_form", "obo_id", "iri", "annotations_trimmed"}

For OLS, this error doesn't arrive because we are indexing a few hundred ontologies which are bound to have synonyms, short_form etc. So whenever a search with q=* happens solr doesn't complain that it can't find the field.

If your requirement is that you want to run the OLS instance with only one ontology that does not have some of the fields mentioned above, then I would suggest you update the Search and Select controllers as per your requirement.

Please let me know if you need any further help or information regarding this.

haideriqbal commented 2 weeks ago

closing this because of inactivity... feel free to reopen if any further help required