Closed megawac closed 9 years ago
What would be the response? Just the correct project name to further query using http://api.jsdelivr.com/v2/jsdelivr/{correctName}
?
Yep, that's what I'm imagining
What if multiple projects match the request? Do we return all of them? Just the first one? How to prioritize?
I think it should always return the closest match (potentially faster) and something similar to this already exists (but isn't the same /libraries?name=*jq
).
An additional endpoint to consider is fuzzymatching (but I don't think thats worthwhile (let the user download the libraries locally))
http://api.jsdelivr.com/v1/jsdelivr/libraries?name=*jq*
Returns like 15 projects with full data :)
Your solution is going to return only 1 and only the name? Like this?
{
"name": "jquery.validation.unobtrusive"
}
END
I was thinking with full data (for the DDG use case)
If its going to return full data then maybe it makes no sense to use a separate endpoint?
This way it would be cleaner http://api.jsdelivr.com/v2/jsdelivr/{searchQuery}
http://api.jsdelivr.com/v2/jsdelivr/{searchQuery}
or http://api.jsdelivr.com/v2/jsdelivr/name={query}
?
Its the same thing I believe https://db.tt/QqVwFcmA
K but this is a different endpoint
On Mon, Jun 1, 2015 at 3:00 PM, Dmitriy Akulov notifications@github.com wrote:
Its the same thing I believe https://db.tt/QqVwFcmA
— Reply to this email directly or view it on GitHub https://github.com/jsdelivr/api/issues/78#issuecomment-107671874.
Ok, then I guess http://api.jsdelivr.com/v2/jsdelivr/name={query}
makes more sense. What do you think?
Agreed!
On Mon, Jun 1, 2015 at 3:25 PM, Dmitriy Akulov notifications@github.com wrote:
Ok, then I guess http://api.jsdelivr.com/v2/jsdelivr/name={query} makes more sense. What do you think?
— Reply to this email directly or view it on GitHub https://github.com/jsdelivr/api/issues/78#issuecomment-107677694.
A query endpoint to find the closest match would be extremely convenient (current use case is duckduckgo spice answers).
What this would involve is determining the library that matches a query as close as possible (e.g.
jwuery
may matchjquery
ifjwuery
is not a library). Another thing this should support is searching for pluginsThere should be an arbitrary threshold to cut off in accurate matches based on levenshtein scores. I'd say
Math.min(query.length / 2, 4)
Imagining the endpoint would be
I'm imagining this returning a single result