Creates the indexes.

@return void
559237
protected function createIndexes()
    {
        $this->createIndex(
            $this->db->getIndexName(TokensRecord::tableName(), 'providerId', false, true),
            TokensRecord::tableName(),
            'providerId',
            false
        );
    }
281462
def create_indices(catalog_slug):
        
        # TODO: enable auto_create_index in the ES nodes to make this implicit.
        # https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#index-creation
        # http://support.searchly.com/customer/en/portal/questions/
        # 16312889-is-automatic-index-creation-disabled-?new=16312889
        mapping = {
            "mappings": {
                "layer": {
                    "properties": {
                        "layer_geoshape": {
                           "type": "geo_shape",
                           "tree": "quadtree",
                           "precision": REGISTRY_MAPPING_PRECISION
                        }
                    }
                }
            }
        }
        ESHypermap.es.indices.create(catalog_slug, ignore=[400, 404], body=mapping)
559344
public function populateIndex()
    {
        $this->buildDocumentsByManager($this->doctrine);

        if ($this->mongo) {
            $this->buildDocumentsByManager($this->mongo);
        }

        if (!empty($this->documents)) {
            $response = $this->searchProvider->addDocuments($this->documents);
            $this->documents = [];
        }
    }
393839
public function orderIndexes() {
        $result = $this->orderElements($this->indexes);
        if ($result) {
            $this->setIndexes($result);
            return true;
        } else {
            return false;
        }
    }
658882
public function createIndex(array $fields = array())
	{
		$properties = array('_geoloc' => array('type' => 'geo_point'));
		
		foreach ($fields as $field) {
			$properties[$field] = array('type' => 'string');
		}
		
		$body['mappings'][static::$default_type]['properties'] = $properties;
		
		$this->getClient()->indices()->create(array(
			'index' => $this->name,
			'body'  => $body,
		));
		
		return true;
	}
783525
public function createIndexes($collection, $indexes)
    {
        $this->beginProfile($token = "    > create indexes on " . $this->composeCollectionLogName($collection) . " (" . Json::encode($indexes) . ") ...");
        $this->db->getCollection($collection)->createIndexes($indexes);
        $this->endProfile($token);
    }
424086
public function createTextIndexes(array $textIndexes)
    {
        if (!empty($textIndexes)) {
            $sm = $this->getSchemaManager();
            foreach ($textIndexes as $tableName => $indexes) {
                if ($sm->tablesExist([$tableName])) {
                    $existingIndexNames = array_map(
                        function (\Doctrine\DBAL\Schema\Index $index) {
                            return $index->getShortestName('');
                        },
                        $sm->listTableIndexes($tableName)
                    );
                    $chunks = [];
                    foreach ($indexes as $indexName => $indexColumns) {
                        if (!in_array(strtolower($indexName), $existingIndexNames, true)) {
                            $newIndexColumns = [];
                            foreach ((array) $indexColumns as $indexColumn) {
                                $indexColumn = (array) $indexColumn;
                                $s = $this->quoteIdentifier($indexColumn[0]);
                                if (!empty($indexColumn[1])) {
                                    $s .= '(' . (int) $indexColumn[1] . ')';
                                }
                                $newIndexColumns[] = $s;
                            }
                            $chunks[] = $this->quoteIdentifier($indexName) . ' (' . implode(', ', $newIndexColumns) . ')';
                        }
                    }
                    if (!empty($chunks)) {
                        $sql = 'ALTER TABLE ' . $this->quoteIdentifier($tableName) . ' ADD INDEX ' . implode(', ADD INDEX ', $chunks);
                        $this->executeQuery($sql);
                    }
                }
            }
        }
    }
397673
protected function _createIndexIfNotExists() {
        $service        = $this->getService();
        $indexExists    = $service->doesIndexExist();

        if ($indexExists) {
            return self::MSG_INDEX_EXISTS;
        }

        return $service->createIndex()
            ? self::MSG_INDEX_CREATED
            : self::MSG_INDEX_CREATION_FAILURE;
    }
1296932
public function createIndexes()
    {
        foreach ($this->schemas as $class => $schema) {
            if ($schema->isEmbedded()) {
                continue;
            }

            $collection = $this->manager->database(
                $schema->getDatabase()
            )->selectCollection(
                $schema->getCollection()
            );

            //Declaring needed indexes
            foreach ($schema->getIndexes() as $index) {
                $collection->createIndex($index->getIndex(), $index->getOptions());
            }
        }
    }
1115155
private function ensureFileIndexes()
    {
        $indexKey = ['filename' => 1, 'uploadDate' => 1];
        foreach ($this->listIndexes() as $index) {
            if ($index['key'] === $indexKey) {
                return;
            }
        }

        $this->createIndex($indexKey);
    }
838204
public function reindex(): void
    {
        $this->index = [];
        $files = $this->scanDirectory($this->sourceDir, LabelIndex::RELATIVE_ROOT);

        foreach ($files as $file) {
            $node = $this->createIndexNode($file);
            $this->index[$node->getKey()] = $node;
        }

        $this->status = IndexInterface::STATUS_REINDEX;
    }
285179
def create_index(self, index):
    

    index._path = os.path.join(self.indexes_path, index._name)

    if whoosh.index.exists_in(index._path):
      _whoosh = whoosh.index.open_dir(index._path)
    elif not os.path.exists(index._path):
      os.makedirs(index._path)
      _whoosh = whoosh.index.create_in(index._path, index._schema)
    index._whoosh = _whoosh
838590
public function index()
    {
        $languages = $this->Languages->find('all');
        $this->set(compact('languages'));
        $this->set('_serialize', ['languages']);
    }
993871
public function get_index()
    {
        if (!$this->indexes) {
            $this->indexes = array();
            if ($json = $this->get_cache('index')) {
                $this->indexes = json_decode($json, true);
            }
        }

        return $this->indexes;
    }
567473
public function index()
    {
        $query = $this->Pages->find()->contain(['Categories' => ['fields' => ['id', 'title']]]);

        $this->paginate['order'] = ['created' => 'DESC'];

        $pages = $this->paginate($this->Pages->queryFromFilter($query, $this->request->getQueryParams()));

        $this->set(compact('pages'));
    }
752685
public function initIndices()
    {
        $elems = $this->node->xpath("value[@key='indices']");
        $this->indices = $this->getFormatter()->createIndices($this, $elems[0]);

        return $this;
    }
871507
private void createIndex() {
        try {
            client.createIndex(name(), workspace, columns.mappings(workspace));
            client.flush(name());
        } catch (IOException e) {
            throw new EsIndexException(e);
        }
    }