Closed Bug 661951 Opened 13 years ago Closed 13 years ago

Tell elastic search to index collections

Categories

(addons.mozilla.org Graveyard :: Search, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clouserw, Assigned: jbalogh)

References

Details

(Whiteboard: [patch][needs review])

Attachments

(1 file)

cvan needs to be able to do (basic text) searches on collections.  Please add a hook for that to elastic search
What text will be getting searched? Does it need filtering on any collection attributes? Where will the searches occur?
Search against collection ID and name. Optional filtering by collection type. Searches will be called from the Admin Panel via an Ajax request (à la the "Create a New Collection" auto-completion - https://addons.allizom.org/en-US/firefox/collections/add).
Can we also add a filter option for application_id? Thanks, Jeff :)
Blocks: 635331
Whiteboard: [patch][needs review]
Target Milestone: 6.1.1 → 6.1.2
cvan: right now this is on https://github.com/jbalogh/zamboni/compare/es but not in master. It's waiting for review from someone, maybe that could be you!

I will now paste me playing with ES from the shell in lieu of documentation (heh). Build the index with `manage.py cron reindex_collections`.

You use .filter() when you want to hit an index (hopefully cached in memory). Doing a .query() is more like a where clause that has to scan each row. I use .filter() for attributes (type, application, is_disabled, is_featured) and .query() for the search (slug='favorites', name='Family Organizer').

Use http://www.elasticsearch.org/guide/reference/query-dsl/ to figure out the syntax. The QuerySet-like wrapper is in amo/search.py. It's by no means complete, so feel free to add what you need or ask me to do it.
https://github.com/jbalogh/zamboni/compare/79907baf21...12789131d
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
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

Created:
Updated:
Size: