gbif / portal-feedback

User feedback for the GBIF API, website and published data. You can ask questions here. 🗨❓
30 stars 16 forks source link

Rerun query from download page - query with IN vs OR #4171

Open gbif-portal opened 2 years ago

gbif-portal commented 2 years ago

Rerun query from download page - query with IN vs OR

@MBLaursen generated a download using the webUI in order to be able to save her query and be able to periodically rerun it. However, once the download is generated, there is no "RERUN QUERY" button in the download page. And I can see that the query saved uses the OR predicate.

However, if I create the query via the API using the IN predicate, the RERUN QUERY button is there: https://www.gbif.org/occurrence/download/0386563-210914110416597

@MortenHofft would it be possible to have the RERUN QUERY button for both types of query? Or maybe have the portal save the query as IN instead of OR?


Github user: @ManonGros User: See in registry - Send email System: Safari 15.3.0 / Mac OS X 10.15.7 Referer: https://www.gbif.org/occurrence/download/0384967-210914110416597 Window size: width 1395 - height 868 API log&_a=(columns:!(_source),filters:!(),index:'3390a910-fcda-11ea-a9ab-4375f2a9d11c',interval:auto,query:(language:kuery,query:''),sort:!())) Site log&_a=(columns:!(_source),filters:!(),index:'5c73f360-fce3-11ea-a9ab-4375f2a9d11c',interval:auto,query:(language:kuery,query:''),sort:!())) System health at time of feedback: OPERATIONAL

MortenHofft commented 2 years ago

I try to detect if it is a query that can be translated to a query that is supported in the UI. That isn't always trivial. A part of me want to remove it altogether as it is fragile and complex. I can look briefly, but honestly I'd rather not spend a lot of time one this. I believe the backend will also rewrite queries at time for optimisation reasons. IN vs OR should be feasible though. But I suspect there are other bugs in there. Such as the flag for case sensitive being added to the API, but the UI do not consider that. So there is a real chance it actually does things wrong. The more I think of it, the more I tend towards removing that functionality 😬

ManonGros commented 2 years ago

Please keep the functionality. I think it is a useful one! It is ok if not all the queries can be rerun but I think users appreciate to be able to rerun at least some of them.

I believe the backend will also rewrite queries at time for optimisation reasons.

Maybe that's the solution then?

MortenHofft commented 2 years ago

Hmm. okay. In that case I should probably do a more proper rewrite of the whole thing. Thanks

MBLaursen commented 2 years ago

I agree with Marie, it is a very useful functionality

MortenHofft commented 7 hours ago

Translating predicates to v1 GET syntax is often not possible. I do not believe in trying to fix this issue in the current stack.

We have since introduced search by predicates which can solve this issue since we can use the exact predicate without trying to map it to something else. I believe this is best fixed in a rewrite of gbif.org where we allow search via predicates.