Closed Bug 837083 Opened 11 years ago Closed 11 years ago

[search] Enhance global search box.

Categories

(Participation Infrastructure :: Phonebook, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
2013-02-07

People

(Reporter: giorgos, Assigned: giorgos)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Enhance the search in global search box.
New Elastic Search configuration.


'id': {'type': 'integer'},
'fullname': {'type': 'string', 'analyzer': 'standard'},
'email': {'type': 'string', 'index': 'not_analyzed'},
'ircname': {'type': 'string', 'index': 'not_analyzed'},
'username': {'type': 'string', 'index': 'not_analyzed'},
'country': {'type': 'string', 'analyzer': 'whitespace'},
'region': {'type': 'string', 'analyzer': 'whitespace'},
'city': {'type': 'string', 'analyzer': 'whitespace'},
'skills': {'type': 'string', 'analyzer': 'whitespace'},
'groups': {'type': 'string', 'analyzer': 'whitespace'},
'languages': {'type': 'string', 'index': 'not_analyzed'},
'bio': {'type': 'string', 'analyzer': 'snowball'},
'is_vouched': {'type': 'boolean'},
'allows_mozilla_sites': {'type': 'boolean'},
'allows_community_sites': {'type': 'boolean'},
'photo': {'type': 'boolean'},
'website': {'type': 'string', 'index': 'not_analyzed'},
'last_updated': {'type': 'date'},
'date_joined': {'type': 'date'}}}


fields = ('username', 'bio__text', 'email', 'ircname',
          'country__text', 'country__text_phrase',
          'region__text', 'region__text_phrase',
          'city__text', 'city__text_phrase',
          'fullname__text', 'fullname__text_phrase',
          'groups__text')

.boost(fullname__text_phraze=5, username=5, email=5, ircname=5,
       fullname__text=4, country__text_phrase=4,
       region__text_phrase=4, city__text_phrase=4,
       bio__text=2)
Hey Giorgos, would you mind adding the couple of lines in this patch to yours, rather than me attempting to merge while you are working in this file?

The patch I'm providing probably won't apply cleanly when you are done, but I'm sure you can manage to the insert the lines :)

This will solve Bug 690423 so I will add this bug as a dependency.
Thanks for the patch sancus. 

I'll merge in only the 'Model' order by attribute. ElasticSearch returns scored results based on your search terms, so the first result should be the most relevant to your search. Re-ordering the results may push down the most relevant mozillian. 

Sounds good?
Does it actually return the results in scored order by default? I think you have to do .order_by(_score) for that to happen. 

The card/bug calls for ordering search results alphabetically, we could try scored results with your new changes and see what Justin/William think.
Yes, ordering by _score is the default. Let's go for _scored now and revisit in a couple of weeks.
Okay, no problem.
Commits pushed to master at https://github.com/mozilla/mozillians

https://github.com/mozilla/mozillians/commit/1a572582f1a4fbf03839fd704951fc58b08f0355
[bug 837083] New elastic search config for global search box.

https://github.com/mozilla/mozillians/commit/e7840f8b02e423ce4e48887525ceb09a60388a7f
Merge pull request #384 from glogiotatidis/search

[bug 837083] New elastic search for global search box.
Target Milestone: --- → 2013-02-07
Good job Giorgos! I think we can resolve this fix and if we want to fiddle with sort order again, we can always reopen or open a new bug.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Bumping to verified as [qa-] - verification will take place in it's dependent, bug 690423.
Status: RESOLVED → VERIFIED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: