Page MenuHomeFreeBSD

WWW: fix search
AbandonedPublic

Authored by lwhsu on Apr 27 2020, 3:14 PM.

Details

Summary

This is a quick fix (workaroun) for the search function of www.freebsd.org. It
add the correct duckduckgo "site:" parameters for the freebsd.org sites we want
to search for the keyword.

Test Plan

cd en_US.ISO8859-1/htdocs; make
open index.html and try to search some keywords

Diff Detail

Repository
rD FreeBSD doc repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

lwhsu requested review of this revision.Apr 27 2020, 3:14 PM
lwhsu created this revision.
bcr added a subscriber: bcr.

That looks good. Can you commit the change yourself or should I do it?

This revision is now accepted and ready to land.Apr 27 2020, 3:28 PM

Put back customized color scheme

This revision now requires review to proceed.Apr 27 2020, 3:55 PM

Tested the search function a little more, using the keyword: "ls", only put "site: www.freebsd.org" has more useful result than passing the whole list. I'm not sure if this is a good move, but it's probably better than the current status and we can improve it in the next rounds.

allanjude added a subscriber: allanjude.

I think having them all is fine

This revision is now accepted and ready to land.Apr 27 2020, 4:43 PM
This revision was automatically updated to reflect the committed changes.
hrs added a subscriber: hrs.

Changes in rD54076 were wrong because listing the domain names with "site:" does not work correctly. I think the correct fix is removing the whitespaces between "site:" and the domain names and using OR keyword to group the domain names like this:

   <div id="search" xmlns="http://www.w3.org/1999/xhtml">
     <form method="get" id="search-form" action="https://duckduckgo.com/"
-      onsubmit="document.getElementById(&#39;words&#39;).value+=&#39; site: www.FreeBSD.org site: docs.FreeBSD.org site: lists.FreeBSD.org site: wiki.FreeBSD.org site: forums.FreeBSD.org&#39;">
+      onsubmit="document.getElementById(&#39;words&#39;).value+=&#39; ( site:www.FreeBSD.org OR site:docs.FreeBSD.org OR site:lists.FreeBSD.org OR site:wiki.FreeBSD.org OR site:forums.FreeBSD.org )&#39;">
       <h2 class="blockhide"><label for="words">&header2.word.search;</label></h2>

I am curious if the current version actually showed correct results. Multiple " site:" keywords cannot be used without OR operator because no operator between the two keywords means "AND" and two "site:" keywords never make sense at the same time. I could reproduce only broken results which include keyword by the user, "site" literally, or index pages of the listed domain names with no search keyword. I believe this was because "site:" and the listed names are interpret as normal keywords, not as operators. Please let me know if someone can get a reasonable result.

Any comments from reviewers of this change? The current search box is still broken as far as I can check. Does it work for you?

In D24590#586582, @hrs wrote:

Any comments from reviewers of this change? The current search box is still broken as far as I can check. Does it work for you?

I've tested this and it does return much better results. Thanks!

In D24590#584957, @hrs wrote:
   <div id="search" xmlns="http://www.w3.org/1999/xhtml">
     <form method="get" id="search-form" action="https://duckduckgo.com/"
-      onsubmit="document.getElementById(&#39;words&#39;).value+=&#39; site: www.FreeBSD.org site: docs.FreeBSD.org site: lists.FreeBSD.org site: wiki.FreeBSD.org site: forums.FreeBSD.org&#39;">
+      onsubmit="document.getElementById(&#39;words&#39;).value+=&#39; ( site:www.FreeBSD.org OR site:docs.FreeBSD.org OR site:lists.FreeBSD.org OR site:wiki.FreeBSD.org OR site:forums.FreeBSD.org )&#39;">
       <h2 class="blockhide"><label for="words">&header2.word.search;</label></h2>

@hrs: do you want to commit it?

Patch in D26703 is committed.