1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 02:42:40 +01:00
phorge-phorge/src/applications/search
epriestley 96fe8c0b83 Implement basic ngram search for Owners Package names
Summary:
Ref T9979. This uses ngrams (specifically, trigrams) to build a reasonably efficient index for substring matching. Specifically, for a package like "Example", with ID 123, we store rows like this:

```
< ex, 123>
<exa, 123>
<xam, 123>
<amp, 123>
<mpl, 123>
<ple, 123>
<le , 123>
```

When the user searches for `exam`, we join this table for packages with tokens `exa` and `xam`. MySQL can do this a lot more efficiently than it can process a `LIKE "%exam%"` query against a huge table.

When the user searches for a one-letter or two-letter string, we only search the beginnings of words. This is probably what they want, the only thing we can do quickly, and a reasonable/expected behavior for typeaheads.

Test Plan:
  - Ran storage upgrades and search indexer.
  - Searched for stuff with "name contains".
  - Used typehaead and got sensible results.
  - Searched for `aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz` and saw only 16 joins.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9979

Differential Revision: https://secure.phabricator.com/D14846
2015-12-22 08:00:33 -08:00
..
application Maniphest - prevent uneditable tasks from being able to be closed as duplicates 2015-05-18 13:07:05 -07:00
applicationpanel Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
config Modernize search engine selection 2015-05-20 06:59:59 +10:00
constants Extend from Phobject 2015-06-15 18:02:27 +10:00
controller Add basic NUX support to SearchEngines 2015-12-19 12:57:13 -08:00
engine Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
engineextension Implement basic ngram search for Owners Package names 2015-12-22 08:00:33 -08:00
field Clean up "ids" and "phids" handling in SearchEngines 2015-12-14 04:24:54 -08:00
fulltextstorage Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
index Allow index extensions to skip indexing if the object has not changed 2015-12-21 17:27:14 -08:00
interface Implement basic ngram search for Owners Package names 2015-12-22 08:00:33 -08:00
management Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
ngrams Implement basic ngram search for Owners Package names 2015-12-22 08:00:33 -08:00
query Rename "SearchEngine" to "FulltextStorageEngine" 2015-12-21 17:26:19 -08:00
storage Allow index extensions to skip indexing if the object has not changed 2015-12-21 17:27:14 -08:00
typeahead Use typeaheads instead of checkbox lists for task status / priority 2015-04-23 11:49:34 -07:00
view Revert "Allow search results to be snippeted, roughly" 2015-09-10 20:57:26 -07:00
worker Convert all "DocumentIndexers" into "FulltextEngines" 2015-12-21 17:25:23 -08:00