Closed KseniyaLight closed 6 years ago
Yeah. Our search results on the API sites (not only api.jquery.com) are kinda inaccurate to say the least.
It would be nice if the search gave priority to the API name matches, so that a search for "wrap" would put those APIs at the top rather than the bottom. Either that or we should stop using the word "wrap" so much everywhere else. :smile:
Nice job tracking those down!
I have made some investigation and found that Relevanssi plugin for WordPress is really great. Here are some results:
'on'
'wrap html'
'wrap html' with search terms highlighting enabled
Of course, I can made our own 'relevant search' but I prefer ready-made solutions.
What do you think? Maybe we should just add this plugin?
Using Relevanssi sounds fine to me. You can just include it in mu-plugins
so we'll get it on every site.
Any updates to this? Using the API search is a pain in the ass.
@MartinMuzatko not yet. PRs improving the situation are welcome (e.g. using the plugin mentioned above).
@mgol PR which is using the plugin above was submitted 2 years ago (https://github.com/jquery/jquery-wp-content/pull/361), but repo owners still can't find time to merge it :).
I'd appreciate a final review of #408 (which is @PaulAnnekov's PR rebased). If that's OK, I'll land it.
The PR rebased & landed, thanks @PaulAnnekov!
I've started testing it on stage before pushing to production and while at http://stage.api.jquery.com/?s=on I see .on()
as the first entry, at the HTTPS version, i.e. https://stage.api.jquery.com/?s=on the results are different (way worse). Any idea what may differ between those two setups? cc @dmethvin
EDIT: disregard, maybe it was cached a little longer, looks great now!
@dmethvin @Krinkle This looks great to me at first sight at https://stage.api.jquery.com/. Do you think it's OK to go to production now?
The search results look really good to me! Yeah let's give it a try.
I released it. I've noticed one regression immediately after releasing: pagination seems broken; the second & subsequent pages return the same results as the first one.
I still think it's way less broken than it was (who goes to the second page of search results after all?) but we should look into it.
It seems to me that all results are contained on one page...
Yes, it does look like all the results are on one page, which is probably why a common word like on
makes the page take so long to render. Pagination is mentioned in a knowledge base article and I don't see that variable set in the init.php
so maybe it's that simple?
For posterity: the pagination issue was resolved in PR #410 by @PaulAnnekov.
Search at api.jquery.com gives inaccurate results.
For example I searched "on" to get ".on()" function docs, but find it at end of results.
I speak with arthurvr about this. He tell: Yeah. I do agree with you. We should probably give the entry title priority in the search results.