Closed Bug 503442 Opened 15 years ago Closed 15 years ago

Forum items before KB items in search results for English searches

Categories

(support.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: cilias, Assigned: paulc)

References

()

Details

(Whiteboard: sumo_only)

Attachments

(1 file)

Search for "enable cookies".
<https://support.mozilla.com/tiki-newsearch.php?where=all&locale=en-US&q=enable+cookies&sa=>

First result is <https://support.mozilla.com/tiki-view_forum_thread.php?comments_parentId=262807&forumId=1>, which is a forum link.

Second result is <https://support.mozilla.com/en/kb/Cannot+log+in+to+websites>, which is a KB article.

Any KB results should be listed before forum results.
I think this can be done with sphinx weight adjustments, but let's wait for the indexer to be fixed first.
Assignee: nobody → paul.craciunoiu
Depends on: 485329
The code in tiki-newsearch.php is very hard to understand. At first, I tried doing this with weights, but they don't seem to be working on stage.

I will file a patch with an easier fix (and probably what the fixed code actually intended). I think we should do a full rewrite of tiki-newsearch.php, or we will have serious problems whenever we need to change something in the future. Several things are hard coded (array values) which will not work for p10n (see lines 55, 112, 143, 213 for hard coded arrays, for example). There's a lot of duplicated code and unreachable code (the patch I will file fixes some of this).
Target Milestone: --- → 1.2.1
Attached patch patch, v1Splinter Review
Attachment #389063 - Flags: review?(laura)
(In reply to comment #2)
> The code in tiki-newsearch.php is very hard to understand. At first, I tried
> doing this with weights, but they don't seem to be working on stage.
> 
> I will file a patch with an easier fix (and probably what the fixed code
> actually intended). I think we should do a full rewrite of tiki-newsearch.php,
> or we will have serious problems whenever we need to change something in the
> future. Several things are hard coded (array values) which will not work for
> p10n (see lines 55, 112, 143, 213 for hard coded arrays, for example). There's
> a lot of duplicated code and unreachable code (the patch I will file fixes some
> of this).

Can you file a specific bug for p10n that covers these issues?  Thanks!
Attachment #389063 - Flags: review?(laura) → review+
Comment on attachment 389063 [details] [diff] [review]
patch, v1

This seems to work but it makes my head hurt.  A lot.  Extra QA please!
I will roll out a patch soon that rewrites tiki-newsearch.php to make it look... more logical. At least it will be a first step to have the code make more sense. This will come out with bug 501880.

And now that I rewrote that code, I actually realize this patch will only work for English searches. When searching with where=all in other locales, KB + Forum articles in English will be mixed up, but KB articles in that locale will stay first (at least!). To make forum posts show up last for other locale searches, we need to rewrite the function get_bests_3() -- would anyone hate me if we do that as part of the rewrite (for bug 501880) instead of here?

r30155 / r30156
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Summary: Forum items before KB items in search results → Forum items before KB items in search results for English searches
Whiteboard: sumo_only
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: