Differential D18581 Diff 44621 src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/query/policy/PhabricatorCursorPagedPolicyAwareQuery.php
Show First 20 Lines • Show All 1,660 Lines • ▼ Show 20 Lines | foreach ($this->ferretTokens as $fulltext_token) { | ||||
$is_stemmed = false; | $is_stemmed = false; | ||||
} else { | } else { | ||||
$is_stemmed = true; | $is_stemmed = true; | ||||
} | } | ||||
if ($is_substring) { | if ($is_substring) { | ||||
$ngrams = $engine->getSubstringNgramsFromString($value); | $ngrams = $engine->getSubstringNgramsFromString($value); | ||||
} else { | } else { | ||||
$ngrams = $engine->getTermNgramsFromString($value); | $terms_value = $engine->newTermsCorpus($value); | ||||
$ngrams = $engine->getTermNgramsFromString($terms_value); | |||||
// If this is a stemmed term, only look for ngrams present in both the | // If this is a stemmed term, only look for ngrams present in both the | ||||
// unstemmed and stemmed variations. | // unstemmed and stemmed variations. | ||||
if ($is_stemmed) { | if ($is_stemmed) { | ||||
$stem_value = $stemmer->stemToken($value); | $stem_value = $stemmer->stemToken($terms_value); | ||||
$stem_ngrams = $engine->getTermNgramsFromString($stem_value); | $stem_ngrams = $engine->getTermNgramsFromString($stem_value); | ||||
$ngrams = array_intersect($ngrams, $stem_ngrams); | $ngrams = array_intersect($ngrams, $stem_ngrams); | ||||
} | } | ||||
} | } | ||||
foreach ($ngrams as $ngram) { | foreach ($ngrams as $ngram) { | ||||
$flat[] = array( | $flat[] = array( | ||||
'table' => $ngram_table, | 'table' => $ngram_table, | ||||
▲ Show 20 Lines • Show All 1,076 Lines • Show Last 20 Lines |