Apply the analysis factory to the index

@param Index                    $index
@param AnalysisFactoryInterface $analysis
337382
public function setAnalysis(Index $index, AnalysisFactoryInterface $analysis)
    {
        $index->create(
            array(
                'number_of_shards' => $this->numberOfShards,
                'number_of_replicas' => $this->numberOfReplicas,
                'analysis' => $analysis->build(),
            )
        );
    }
580996
public function handle(Client $client, $index, $type, $alias)
    {
        $mapping = $this->configurations->getMapping($alias, $type);

        if (!$mapping) {
            throw new \InvalidArgumentException();
        }

        $client
            ->getIndex($index)
            ->getType($type)
            ->setMapping($mapping)
        ;
    }
1219339
public function createIndex()
    {
        //create analysis
        $analysis = $this->container->get(
            'kunstmaan_search.search.factory.analysis'
        );

        foreach ($this->locales as $locale) {
            // Multilanguage check
            if (preg_match('/[a-z]{2}_?+[a-zA-Z]{2}/', $locale)) {
                $locale = strtolower($locale);
            }

            // Build new index
            $index = $this->searchProvider->createIndex($this->indexName . '_' . $locale);

            if (array_key_exists($locale, $this->analyzerLanguages)) {
                $localeAnalysis = clone $analysis;
                $language = $this->analyzerLanguages[$locale]['analyzer'];

                // Create index with analysis
                $this->setAnalysis($index, $localeAnalysis->setupLanguage($language));
            } else {
                $index->create();
            }

            $this->setMapping($index, $locale);
        }
    }
424287
protected function addIndex(&$property, Index $index)
    {
        $property .= sprintf("('%s')", $this->getPropertyBase($index->getType), $index->name);

        return $this->addFieldPropertyClousure($property);
    }
674450
public static function remove($index)
    {
        if (isset(self::$views[$index])) {
            self::$views[$index] = null;
        }
    }
752582
public function set_analysable(\core_analytics\analysable $analysable) {
        $this->analysable = $analysable;
        $this->ranges = $this->define_ranges();
        $this->validate_ranges();
    }
979759
public function handle(Client $client, $index, $alias)
    {
        $config = $this->configurations->get($alias);

        if (null === $config) {
            throw new \InvalidArgumentException();
        }

        $client->getIndex($index)->create($config);
    }
206288
protected function checkIndex(Index $index, IgnoredChange $ignoredChange)
    {
        // Not needed to be implemented yet
        if ($ignoredChange->getPropertyName() !== $index->getName()) {
            return false;
        }

        return false;
    }
951515
public function createIndexIfNotExists(\Smile\ElasticsuiteCore\Api\Index\IndexInterface $index, $store)
    {
        if ($this->client->indexExists($index->getName()) === false) {
            $indexSettings = array_merge($this->indexSettings->getCreateIndexSettings(), $this->indexSettings->getInstallIndexSettings());
            $indexSettings['analysis'] = $this->indexSettings->getAnalysisSettings($store);
            $this->client->createIndex($index->getName(), $indexSettings);
            $this->client->updateAliases([['add' => ['index' => $index->getName(), 'alias' => $index->getIdentifier()]]]);
            foreach ($index->getTypes() as $currentType) {
                $this->client->putMapping($index->getName(), $currentType->getName(), $currentType->getMapping()->asArray());
            }
        }
    }
1014848
public function deriveColumn($index)
    {
        $this->validateColumnIndex($index);
        
        $column = new DerivedColumn($this->columns[$index]->getAlias());
        
        return $column->setTable($this);
    }
539747
public function transAlterIndex($table, $index, $schema)
    {
        $this->transInitTable($table);
        $this->schemaUpdateTransaction[$table]['alteredIndexes'][$index] = $schema;
    }
1368012
public function dropPrimary($index = null, $ignoreIfNotExist = false)
    {
        $this->connection->openBucket($this->getTable())
            ->manager()->dropN1qlPrimaryIndex($this->detectIndexName($index), $ignoreIfNotExist);
    }
54165
public function addIndex($type, $index)
    {
        if (!isset($this->indexes[$type])) {
            $this->indexes[$type] = [];
        }

        $this->indexes[$type][] = $index;
    }
964047
public function setAnalyzer(string $analyzer): self
    {
        $analyzer = \trim($analyzer);

        return $this->setParam('analyzer', $analyzer);
    }
1168308
protected function setMapping(Index $index, $lang = 'en')
    {
        $mapping = $this->createDefaultSearchFieldsMapping($index, $lang);
        $mapping->send();
        $index->refresh();
    }
82891
public void analyze(Analyzer analyzer, boolean allowFlow)
    throws Exception
  {
    analyzeImpl(analyzer, allowFlow, new IntArray(), new IntArray());
  }
424502
public function handle(Client $client, $index, $alias)
    {
        $client->getIndex($index)->removeAlias($alias);
    }