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

searchvalues not returning study Names #54

Open
will-moore opened this issue Sep 8, 2022 · 4 comments
Open

searchvalues not returning study Names #54

will-moore opened this issue Sep 8, 2022 · 4 comments

Comments

@will-moore
Copy link
Member

Trying to find studies by Name or IDR number with:

https://idr-testing.openmicroscopy.org/searchengine/api/v1/resources/all/searchvalues/?value=idr0012&key=Name+(IDR+number)

doesn't return anything. Removing the key doesn't help (finds 1 other match but not Name).

@will-moore
Copy link
Member Author

In order to replace the manual JavaScript - based approach to searching for Studies, I can use Key-Value pairs to search for studies using the search engine (see IDR/idr-gallery#20) but I still have to use a 'manual' approach or different endpoints for searching for Name and Description.
In #57 I should be able to search by Name, or load ALL names and filter locally. But I would have to do the same again for description and then combine those results with the /searchvalues/ endpoint to provide auto-complete results.

It would be really nice if "Name" and "Description" were considered to be Key/Value pairs on the objects for the purposes of
searchvalues.
Or this could be optional with https://idr-testing.openmicroscopy.org/searchengine/api/v1/resources/all/searchvalues/?value=idr0012&key=Name&key=Description and the default behaviour would be just to search kv pairs?

@khaledk2
Copy link
Collaborator

I have modified the names endpoint to be able to search both names and descriptions. The user needs to add use_description=true in the URL, then the searchengine searches both name and description using the provided value. The returned result is a dict which contains the study names and the descriptions.

For example, to search all the studies (screens and projects) which their names or description containing cell, the user can submit this request:

http://idr-testing.openmicroscopy.org/searchengine/api/v1/resources/all/names/?value=cell&use_description=true

The current behaviour is maintained if the user does not set use_description=true.

It is deployed in idr-testing, Please check it and let me what do you think.

@will-moore
Copy link
Member Author

This is actually working fine for me, but I'm worried this is not going to work so well outside of IDR since it assumes that the Name can be used as a project/screen identifier.
Only in IDR can we assume that Names are unique. If omero_search_engine is used elsewhere, we will need the object ID.
Probably a better format is:

{
  "screens": [
    {"id": 123, "Name": "My Screen", "Description": "Screen Description"}
  ],
  "projects": []
}

This would also allow us to add other info in future, e.g. group, owner, creation-date etc.

@will-moore
Copy link
Member Author

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

No branches or pull requests

2 participants