Complex queries
will-moore opened this issue · comments
Will Moore commented
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:
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 commented
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 commented
@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.