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 by value only #83

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

khaledk2
Copy link
Collaborator

This PR adds support to search by value only without using the key.

@khaledk2
Copy link
Collaborator Author

This PR has been deployed on the idr-testing

The following example will search for the images which have value = pdx regardless of the key.

https://idr-testing.openmicroscopy.org/searchengine//api/v1/resources/image/search/?value=pdx&operator=equals

It supports search by value only in addition it can be used as a part of complex queries, e.g mixing search by key and value with search by value.

For example, the following query will search for the images which have cell type = m481, and value = pdx regardless of whether the key is for the latter

{
   "query_details":{
      "and_filters":[
         {
            "name":"Cell Type",
            "value":"m481",
            "operator":"equals",
            "resource":"image"
         },
         {
            "value":"pdx",
            "operator":"equals",
            "resource":"image"
         }
      ],
      "or_filters":[
         
      ]
   }
}

curl command can be used for the previous query:

curl -X POST "https://idr-testing.openmicroscopy.org/searchengine//api/v1/resources/submitquery/" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"query_details\": {\"and_filters\": [{\"name\": \"Cell Type\",\"value\": \"m481\",\"operator\": \"equals\",\"resource\": \"image\"},{\"value\": \"pdx\",\"operator\": \"equals\",\"resource\": \"image\"}],\"or_filters\": []}}"

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

Successfully merging this pull request may close these issues.

1 participant