ome / omero_search_engine

App which is used to search metadata (key-value pairs)
GNU General Public License v2.0
1 stars 4 forks source link

submitquery: "name" rename to "key" #42

Open will-moore opened 2 years ago

will-moore commented 2 years ago

The query at /searchengine//api/v1/resources/submitquery/ requires JSON and/or filters to be in this form:

{
"name": "Cell Line",
"value": "hela",
"operator": "equals",
"resource": "image"
},

However, everywhere else we use key instead of name. Adopting that here would improve consistency and allow me to pass the same dictionary of queries between different parts of the api. I guess we could support both name/key if we wanted to avoid breaking changes, but might be better to make breaking changes at this early stage.

khaledk2 commented 2 years ago

It will affect the filter format, i.e. keywill be used instead of name


      "and_filters":[
         {
            "key":"Cell Line",
            "value":"hela",
            "operator":"equals",
            "resource":"image"
         }
      ]

To be consistent, the same should affect the results (key_vaalues part), i.e. keywill be used instead of name

 "key_values": [
          {
            "index": 0,
            "key": "Cell Line",
            "value": "HeLa"
          },
          {
            "index": 0,
            "key": "Comments",
            "value": "annotation not available"
          },
          {
.....
]

If everyone is happy about this change, I can start implementing it.

will-moore commented 2 years ago

Great, thanks 👍