Molecular-Biophysics-Database / mbdb-input-ui

Prototype implementation of the input forms
Other
0 stars 0 forks source link

Vocabulary searches are not searching the full set of available vocabularies #94

Closed edager closed 9 months ago

edager commented 10 months ago

Even though 1000 vocabularies are available in the backend, it appear that only the first few are searchable.

@mesemus mentioned that the vocabulary endpoint is only called once at render time, and this only uses the first page of the result.

Update: Just checked the endpoint in src/mbdb/vocabularies.ts:

function makeUrl(type: string) {
    if (!Config.get('vocabulariesApiEndpoint')) {
        throw new Error('Cannot make a URL for vocabulary API query because the application is misconfigured.');
    }

    // BEWARE, BEWARE, BEWARE:
    // The inconsistency, or rather lack of thereof, is about the hit you in the face.
    // This URL shall *not* end with a trailing slash, otherwise the API request will fail.
    return `${Config.get('baseUrl')}/api/${Config.get('vocabulariesApiEndpoint')}/${type}`;
}

And it does indeed only return a limited number (25) of vocabularies under hits, however under links it has a link to next page.

I suspect a change in strategy is needed, such that the endpoint query is passed to the endpoint, and the results are reformatted, rather than caching the vocabularies (?) and searching in that cache.

MadCatX commented 10 months ago

Relevant PR https://github.com/Molecular-Biophysics-Database/mbdb-input-ui/pull/95