Build a doc ready for the titlesuggest index.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html Builder used to create suggester docs NOTE: Experimental
CirrusSearch\BuildDocument\Completion\SuggestBuilder::extractTitleAndSimilarRedirects |
( |
array | $doc | ) |
|
Extracts title with redirects that are very close.
It will allow to make one suggestion with title as the output and title + similar redirects as the inputs. It can be useful to avoid displaying redirects created to to handle typos.
e.g. : title: Giraffe redirects: Girafe, Girraffe, Mating Giraffes will output
- 'group' : { 'text': 'Giraffe', 'variants': ['Girafe', 'Girraffe'] }
- 'candidates' : ['Mating Giraffes']
It would be nice to do this for redirects but we have no way to decide which redirect is a typo and this technique would simply take the first redirect in the list.
- Parameters
-
- Returns
- array mixed 'group' key contains the group with the lead and its variants and 'candidates' contains the remaining candidates that were not close enough to $groupHead.