Closed Bug 277851 Opened 20 years ago Closed 15 years ago

Highlight search results

Categories

(addons.mozilla.org Graveyard :: Search, enhancement, P5)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: Bugzilla-alanjstrBugs, Assigned: wenzel)

References

()

Details

Attachments

(3 obsolete files)

When we search for terms, we should highlight in the results the words they
searched for.  Neato.
Might as well.
Status: NEW → ASSIGNED
Assignee: nobody → ted.mielczarek
Status: ASSIGNED → NEW
Target Milestone: 1.0 → 2.0
There would need to be a separate interface to this from the find bar.

How exactly do you expect to be able to implement this? For example, just in the
major search sites you have (search for term 'foo', stripping out the rest of
the parameters)
http://www.google.com/search?q=foo
http://search.yahoo.com/search?p=foo

Google uses q=, Yahoo! uses p=. The INPUT tag in the Google/Yahoo! pages are
also named differently (q,p).

How do you expect to be able to correctly identify the search terms on every
search page on the internet? What about if it's an internal site search and the
site already provides its own highlighting?
Ian -

This is about the internal search on addons.mozilla.org.
needs testing (I have no data in my setup yet) but basically should work. tried
it locally with a few random strings and some edge cases.
Actually, I can't see anywhere that $searchStr is cleaned, may need to run
strip_tags over it first.
You'll need to rewrite this to use the new site with templates:
http://lxr.mozilla.org/mozilla/source/webtools/addons/search.php

Highlight based on the value(s) in q, such that search.php?q=foo highlights "foo"
I like what you've done, but I think we should leave cleaning the input
(multiple spaces, "and", etc) to a separate line.

Would you like this bug reassigned to you?  
Instead of using spans, perhaps we should use something with more semantic
meaning, like em tags.
Attached patch less condensed, more flexible (obsolete) — Splinter Review
Splits the $searchTerms handling to try to make it simpler.
Now does case-insensitive comparision and works on the title too.

I added the title since I couldn't get it to highlight my own extension, but
plenty of highlight for the guy below me. Search is likely to be done from
memory, which is likely to use something in the name.

You can give this one to me.
Attachment #199000 - Attachment is obsolete: true
Attached patch for amo/v2 (obsolete) — Splinter Review
Mostly handled in the template.
Cleans up the search query, which can't hurt others anyway.
Doesn't require terms to be on word boundaries. This is something we just need
to make a decision on. The SQL doesn't care about word boundaries, '%blah%',
but I suspect there will be cases where it will be less than intuitive.
Attachment #199054 - Flags: first-review?(cst)
Assignee: ted.mielczarek → paul
Attachment #199054 - Flags: first-review?(cst) → first-review?(morgamic)
Whiteboard: [cst: drop \b from umo1 patch if r=cst]
Comment on attachment 199049 [details] [diff] [review]
less condensed, more flexible

UMO v2 is live.  I had a lot less to do with its development, so check with morgamic before using me for reviews.
Attachment #199049 - Flags: first-review?(cst)
Attachment #199049 - Attachment is obsolete: true
AMO bugspam. Correcting QA contacts on OLD bugs (mozilla.update@update.bugs)

-> Correct QA contact (web-ui@add-ons.bugs)

Filtermeplzkthx
QA Contact: mozilla.update → web-ui
Reassigning to default assignee, I'm not working on AMO right now.
Assignee: paul → nobody
Comment on attachment 199054 [details] [diff] [review]
for amo/v2

We're no longer on v2.
Attachment #199054 - Flags: first-review?(morgamic)
This can have some nasty a11y effects as I understand it, and we'd want to be pretty darned careful that we don't add XSS vulnerability paths by splitting content where the other sanitizers don't expect.  We could perhaps ship some JS that did this on the client side...
Severity: normal → enhancement
Whiteboard: [cst: drop \b from umo1 patch if r=cst]
Target Milestone: 2.0 → Future
Attachment #199054 - Attachment is obsolete: true
Assignee: nobody → fwenzel
Component: Public Pages → Search
Priority: -- → P5
We could utilize something like:

http://www.jquery.info/spip.php?article50

But I feel like the overhead of JS highlighting is not really worth it, most things our search engine finds are obvious matches - highlighting makes more sense in dense documents.  In our case, addons details aren't very dense.

I'd favor wontfix'ing this.
Dave brings up a good point - our results aren't dense.  The results for our searches are limited to 3 lines of text which should be easy enough to scan.  -> wontfix.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: