Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12805)

Issue 117810044: Make ngram searches work.

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by bac
Modified:
9 years, 9 months ago
Reviewers:
mp+226910
Visibility:
Public.

Description

Make ngram searches work. After the ngram search was deployed it was discovered to only work if 1) using the API and 2) had autocomplete=true. Inspecting the code showed the intent for ngram to be used in other situations, and there was not documented rationale for only using it when doing autocomplete. The problem was simply in the query for non-autocomplete the field for the ngrams was prefixed with 'data.' when it should not have been. The ngrams fields were moved out of the charm and bundle fields and passed as separate fields, treated like 'provides' and 'requires', to avoid the prefixing. As a result of this change, the search on the manage.jujucharms.com page now uses ngrams too. QA: First, ingest some data: # ttyn $ make run # ttyn+1 $ bin/es-update $ bin/ingest-queued --prefix=~cabs-team/ ## gets sugarcrm $ bin/ingest-queued --prefix=~charmers/charms/ ## gets a bunch of charms $ bin/ingest-queued --prefix=~bac ## gets a bundle Without autocomplete an ngram search is done in addition to the other fields. This search will find items with 'popular' in the description. http://127.0.0.1:2464/api/3/search?text=popular But turning on autocomplete limits to the ngram of the item name. Nothing found. http://127.0.0.1:2464/api/3/search?text=popular&autocomplete=true These two should find items with names and free text, followed by just names. http://127.0.0.1:2464/api/3/search?text=sql http://127.0.0.1:2464/api/3/search?text=sql&autocomplete=true This is the entry point used by the search box on the web page. http://127.0.0.1:2464/api/3/search?text=sql https://code.launchpad.net/~bac/charmworld/ngram-inquiry/+merge/226910 (do not edit description out of merge proposal)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -9 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charmworld/search.py View 4 chunks +6 lines, -7 lines 0 comments Download
M charmworld/tests/test_search.py View 3 chunks +66 lines, -2 lines 0 comments Download

Messages

Total messages: 1
bac
9 years, 9 months ago (2014-07-15 19:51:43 UTC) #1
Please take a look.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b