Open PaulBoon opened 3 years ago
Thank you for the issue. You are right. This has been deliberately disabled in the code, because it could return an excessive number of results, leading to performance issues etc. Can I ask what is your underlying problem / use case you are trying to solve here? Would the search
method be best for this purpose, or would some other method actually be better?
There was an attempt (PR #739) at providing a REST method that would return all concepts in a vocabulary. Unfortunately the work was never completed.
Hi @osma, my 'use case' is populating an autocomplete and have it dropdown the complete list if the user pushes the arrow keys without any character typed in yet. This enables the user to see all possible values so there is no guessing of the first character (typing a, b, c* etc.).
This is not disabled completely, if I use a subset of a vocabulary using the parent parameter for instance, I was able to get results with the query parameter *
.
What I would expect reading the documentation is some way to get paged results, the parameters offset
and maxhits
suggest this. Also it would be useful to somehow indicate the total number of hits in the json response, thus letting clients know that not all results are in the response.
Right now I would have to guess that the results are to large and this is not even mentioned in the documentation.
What I would like to suggest is that the documentation is updated, specifying when (at what number of potential results) these are discarded. When implementing an autocomplet for a specific vocabulary I can check if the results will be too large and change the autocomplet behaviour.
Returning an empty results array can be useful, because it indicates to a user of the autocomplete that more characters need to be typed. But at this moment it is undocumented behaviour.
At which URL did you encounter the problem?
http://skosmos.dev.finto.fi/rest/v1/search?vocab=unesco&query=*
What steps will reproduce the problem?
curl "http://skosmos.dev.finto.fi/rest/v1/search?vocab=unesco&query=*" | jq
What is the expected output? What do you see instead?
I expect to get the results, at least up to the default maximum of 100 terms, instead I get an empty array in the results
{ "@context": { "skos": "http://www.w3.org/2004/02/skos/core#", "isothes": "http://purl.org/iso25964/skos-thes#", "onki": "http://schema.onki.fi/onki#", "uri": "@id", "type": "@type", "results": { "@id": "onki:results", "@container": "@list" }, "prefLabel": "skos:prefLabel", "altLabel": "skos:altLabel", "hiddenLabel": "skos:hiddenLabel" }, "uri": "", "results": [] }
Even when specifying a maximum of 10, I get no results;curl "http://skosmos.dev.finto.fi/rest/v1/search?vocab=unesco&maxhits=10&query=*"
orcurl -k "http://skosmos.dev.finto.fi/rest/v1/unesco/search?maxhits=10&query=*"
But when I use an extra character before the
'*'
, like'a*'
I do get results.What browser did you use? (eg. Firefox, Chrome, Safari, Internet explorer)
Commandline or browser