Open AndrewVSutherland opened 2 years ago
How crazy would it be to make an interface for constructing the api query? I am picturing 4 columns:
First: Pull-down menu to choose the Collection
Second Then appears a long checklist of fields to select on
When you check the box next to the field,
Third choose the relation: equals (i.e. an integer), approximately (float), in_range, true/false, some other options
4th A text input, or more than 1 text input appears to accept your choice(s) to specify that part of the search.
Do this for as many fields as you want to search on, to have "and" all of those results match (which is the only option now).
Maybe that interface can be automatically generated from the Collection's schema.
Picking the collection is not enough, one needs to pick the table, as the tables are all interconnected ad hocly.
Having an API helper to construct the API query seems useful, but I wouldn't go as far as helping people write the logical part of the query, as that would require a lot of work for a minimal benefit. Instead, I would just point them to https://github.com/LMFDB/lmfdb/blob/master/lmfdb/backend/searchtable.py#L139
The page https://www.lmfdb.org/api/ plays a key role for LMFDB developers and LMFDB users who want to access the raw data, so it would be worth spending some time thinking carefully about its layout/design. Some possible improvements: