Merge lp:~reedobrien/charmworld/ngrams into lp:charmworld
Status: | Merged |
---|---|
Approved by: | Reed O'Brien |
Approved revision: | 516 |
Merged at revision: | 509 |
Proposed branch: | lp:~reedobrien/charmworld/ngrams |
Merge into: | lp:charmworld |
Diff against target: |
359 lines (+184/-21) 3 files modified
Makefile (+2/-2) charmworld/search.py (+104/-8) charmworld/tests/test_search.py (+78/-11) |
To merge this branch: | bzr merge lp:~reedobrien/charmworld/ngrams |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Gui Bot | continuous-integration | Approve | |
Richard Harding | Approve | ||
j.c.sackett (community) | Approve | ||
Review via email: mp+218821@code.launchpad.net |
Commit message
adds ngrams as multifield index to name. skips destructive test -- see Bug #1317567
Description of the change
Allow finding sugarcrm by searching for crm, or postgresql, cf-mysql, and mysql by searching for sql.
Changes:
- Adds a multifield index for name with exact field and 3-20 ngrams analyzer.
- Fixes and adds tests for new index.
- Updates api_search with autocomplete=True to use the ngrams field.
Secondary changes:
- removes one test which deleted all ES data when run
- updates ppa:juju/pkgs -> ppa:juju/stable
- removes svn from sysdeps
Caveats:
I think that this will analyze the query which may mean that searching with no minimum matching set may be greedier than desired. AFAIU, this accomplishes what was desired.
Relevance is subjective so I didn't try tuning for relevance. The results I get look good to me at a glance:)
Also, the minimum ngram is 3 so there *isn't likely any good reason for the gui to send requests at 1 or 2 chars in the search box*.
Once built ingest charms as follows for testing:
# ttyn
$ make run
# ttyn+1
$ bin/es-update
$ bin/ingest-queued --prefix=
$ bin/ingest-queued --prefix=
$ bin/ingest-queued --prefix=~bac ## gets a bundle
Code looks good, I'm qaing now.
Can you file a bug about the test you had to comment out?