jquery / jquery-wp-content

WordPress themes and plugins for the jQuery sites
GNU General Public License v2.0
253 stars 169 forks source link

Search at api.jquery.com gives inaccurate results. #359

Closed KseniyaLight closed 6 years ago

KseniyaLight commented 9 years ago

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.

arthurvr commented 9 years ago

Yeah. Our search results on the API sites (not only api.jquery.com) are kinda inaccurate to say the least.

dmethvin commented 9 years ago

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:

PaulAnnekov commented 9 years ago

Will try to make pull request with fix tomorrow. Bug is here (not search_term, but search_terms) and here (post_title is on(), but search term is just on, they are not equal and will not match).

jzaefferer commented 9 years ago

Nice job tracking those down!

PaulAnnekov commented 9 years ago

I have made some investigation and found that Relevanssi plugin for WordPress is really great. Here are some results:

on 'on'

wrap 'wrap html'

wrap_highlight 'wrap html' with search terms highlighting enabled

PaulAnnekov commented 9 years ago

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?

scottgonzalez commented 9 years ago

Using Relevanssi sounds fine to me. You can just include it in mu-plugins so we'll get it on every site.

MartinMuzatko commented 7 years ago

Any updates to this? Using the API search is a pain in the ass.

mgol commented 7 years ago

@MartinMuzatko not yet. PRs improving the situation are welcome (e.g. using the plugin mentioned above).

PaulAnnekov commented 7 years ago

@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 :).

mgol commented 6 years ago

I'd appreciate a final review of #408 (which is @PaulAnnekov's PR rebased). If that's OK, I'll land it.

mgol commented 6 years ago

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!

mgol commented 6 years ago

@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?

dmethvin commented 6 years ago

The search results look really good to me! Yeah let's give it a try.

mgol commented 6 years ago

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...

dmethvin commented 6 years ago

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?

mgol commented 6 years ago

For posterity: the pagination issue was resolved in PR #410 by @PaulAnnekov.