@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove some redundant information from the Ferret engine index

Summary:
Ref T12819. The "full" field has all other fields, and the "core" field has "title" and "body". Due to the way the "full" and "core" fields were being built, the "core" field also got included in the "full" field, so the "full" field has two copies of the title, two copies of the body, and then one copy of everything else.

Put only one copy of each distinct thing in each "full" and "core". Also, simplify the logic a little bit so we build these virtual fields in a more consistent way.

Test Plan: Ran `bin/search index` and looked at the fields in the database, saw less redundant information.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T12819

Differential Revision: https://secure.phabricator.com/D18580

+6 -9
+6 -9
src/applications/search/engineextension/PhabricatorFerretFulltextEngineExtension.php
··· 66 66 ); 67 67 break; 68 68 } 69 + 70 + $virtual_fields[] = array( 71 + PhabricatorSearchDocumentFieldType::FIELD_ALL, 72 + $raw_corpus, 73 + ); 69 74 } 70 - 71 - $key_all = PhabricatorSearchDocumentFieldType::FIELD_ALL; 72 75 73 76 $empty_template = array( 74 77 'raw' => array(), ··· 76 79 'normal' => array(), 77 80 ); 78 81 79 - $ferret_corpus_map = array( 80 - $key_all => $empty_template, 81 - ); 82 + $ferret_corpus_map = array(); 82 83 83 84 foreach ($virtual_fields as $field) { 84 85 list($key, $raw_corpus) = $field; ··· 98 99 $ferret_corpus_map[$key]['raw'][] = $raw_corpus; 99 100 $ferret_corpus_map[$key]['term'][] = $term_corpus; 100 101 $ferret_corpus_map[$key]['normal'][] = $normal_corpus; 101 - 102 - $ferret_corpus_map[$key_all]['raw'][] = $raw_corpus; 103 - $ferret_corpus_map[$key_all]['term'][] = $term_corpus; 104 - $ferret_corpus_map[$key_all]['normal'][] = $normal_corpus; 105 102 } 106 103 107 104 $ferret_fields = array();