Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rombaum opened this issue Oct 10, 2024 · 1 comment
Labels

Comments

@rombaum
Copy link

rombaum commented Oct 10, 2024

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.

@rombaum rombaum added the bug label Oct 10, 2024
@haideriqbal
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants