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

Complex queries #33

Open
will-moore opened this issue May 12, 2023 · 2 comments · May be fixed by #34
Open

Complex queries #33

will-moore opened this issue May 12, 2023 · 2 comments · May be fixed by #34

Comments

@will-moore
Copy link
Member

The searchengine backend supports complex nested queries, but we haven't exposed this in the UI yet.

The main missing feature is the support for converting this query into a URL

Currently have this working, but needs improved UI tweaks:

Screenshot 2023-05-12 at 10 05 13

This query generated is:

{
  "resource": "image",
  "query_details": {
    "and_filters": [
      {
        "name": "Gene Symbol",
        "value": "pdx1",
        "operator": "contains",
        "resource": "image"
      },
      {
        "name": "Pathology",
        "value": "carcinoid, malignant, nos",
        "operator": "contains",
        "resource": "image"
      }
    ],
    "or_filters": [
      [
        {
          "name": "Organism Part",
          "value": "small intestine",
          "operator": "contains",
          "resource": "image"
        },
        {
          "name": "Organism Part",
          "value": "duodenum",
          "operator": "contains",
          "resource": "image"
        }
      ]
    ],
    "case_sensitive": false
  },
  "mode": "searchterms"
}
@will-moore
Copy link
Member Author

Using jsonurl library, this gives a URL for the query above like:

idr_gallery/search/?q=(((key:Organism+Part,value:small+intestine,operator:contains,resource:image),
(key:Organism+Part,value:duodenum,operator:contains,resource:image)),
(key:Gene+Symbol,value:pdx1,operator:contains,resource:image),
(key:Pathology,value:carcinoid!,+malignant!,+nos,operator:contains,resource:image))

@will-moore
Copy link
Member Author

@sbesson noted that query string is limited to 4k characters on most servers.
The query above is 292 characters, so we are a good way off reaching that limit, but good to keep in mind.

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 a pull request may close this issue.

1 participant