Rebuild the entire index from provided elements.
358197
private function rebuildAttrIndex(string $key)
	{
		$this->index[$key] = [];

		foreach ($this->elements as $id => $element) {
			if ($element instanceof $this->elementClassName) {
				$value = $element->getAttr($key);
				$this->index[$key][$value][$id] = $element;
			} else {
				throw new \InvalidArgumentException("Indexed element must be instance of " . $this->elementClassName);
			}
		}
	}
1367195
public void rebuildIndex(String indexName, I_CmsReport report) throws CmsException {

        try {
            SEARCH_MANAGER_LOCK.lock();
            // get the search index by name
            I_CmsSearchIndex index = getIndex(indexName);
            // update the index
            updateIndex(index, report, null);
            // clean up the extraction result cache
            cleanExtractionCache();
        } finally {
            SEARCH_MANAGER_LOCK.unlock();
        }
    }
171913
def _rebuild_circle(self):
        """"""
        self._hashring = {}
        self._sorted_keys = []
        total_weight = 0
        for node in self._nodes:
            total_weight += self._weights.get(node, 1)

        for node in self._nodes:
            weight = self._weights.get(node, 1)

            ks = math.floor((40 * len(self._nodes) * weight) / total_weight)

            for i in xrange(0, int(ks)):
                k = md5_bytes('%s-%s-salt' % (node, i))

                for l in xrange(0, 4):
                    key = ((k[3 + l * 4] << 24) | (k[2 + l * 4] << 16) |
                           (k[1 + l * 4] << 8) | k[l * 4])
                    self._hashring[key] = node
                    self._sorted_keys.append(key)

        self._sorted_keys.sort()
758353
private int[] reIndexIndices(SortableVertex[] sortVertices, int[] indices) {
        // Create temporary lookup-array, O(n)
        int[] indexLUT = new int[sortVertices.length];
        int[] newIndices = new int[indices.length];

        for (int i = 0; i < sortVertices.length; ++i) {
            indexLUT[sortVertices[i].originalIndex] = i;
        }

        // Convert old indices to new indices, O(n)
        for (int i = 0; i < indices.length; ++i) {
            newIndices[i] = indexLUT[indices[i]];
        }


        return newIndices;
    }
74173
def reindex(self, new_index_name: str, identifier_key: str, **kwargs) -> 'ElasticIndex':
        
        if 'url' not in kwargs:
            kwargs['url'] = self.url
        if 'doc_type' not in kwargs:
            kwargs['doc_type'] = self.doc_type
        if 'mapping' not in kwargs:
            kwargs['mapping'] = self.mapping
        new_index = ElasticIndex(new_index_name, **kwargs)

        for results in self.scroll(size=500):
            new_index.bulk(results, identifier_key)
        return new_index
702012
def rebuild(self):
        """"""
        movi = self.riff.find('LIST', 'movi')
        movi.chunks = self.combine_streams()
        self.rebuild_index()
227648
def go_to_index(self, index):
        
        return CompletionState(self.original_document, self.current_completions, complete_index=index)
1196019
public synchronized void refreshIndexes() {
		/*
		 * cache index by Bin name
		 */
		if (this.indexCache == null)
			this.indexCache = new TreeMap<String, Index>();

		Node[] nodes = client.getNodes();
		for (Node node : nodes) {
			if (node.isActive()) {
				try {
					String indexString = Info.request(getInfoPolicy(), node, "sindex");
					if (!indexString.isEmpty()) {
						String[] indexList = indexString.split(";");
						for (String oneIndexString : indexList) {
							Index index = new Index(oneIndexString);
							this.indexCache.put(index.toKeyString(), index);
						}
					}
					break;
				} catch (AerospikeException e) {
					log.error("Error geting Index informaton", e);
				}
			}
		}
	}
1232097
def _reindex(self):
        
        self.index = []
        for path in self.paths:
            target_path = os.path.normpath(os.path.join(BASE_PATH,
                                                        path))
            for root, subdirs, files in os.walk(target_path):
                for f in files:
                    self.index.append(
                        (os.path.join(root, f).lower(),
                         os.path.join(root, f)))
1010073
protected function remakeAutoIncrementIndex() : void
    {
        $nCollection = [];

        $c = 0;
        foreach ($this->collection as $val) {
            $nCollection[(string)$c] = $val;
            $c++;
        }

        $this->collection = $nCollection;
    }
257150
public function reindex()
    {
        if ($this->index_field !== null) {
            $this->objects_by_index = array();
            $index_field = $this->index_field;
            foreach ($this->objects as $object) {
                if (isset($object->$index_field)) {
                    $this->objects_by_index[$object->$index_field] = $object;
                }
            }
        }
    }
547455
def rebuild_index(self):
        """"""
        try:
            os.remove(environ.index_db_re)
        except:
            pass

        self.db_conn = sqlite3.connect(environ.index_db_re)
        self.db_cursor = self.db_conn.cursor()
        self.db_cursor.execute('CREATE TABLE "cplusplus.com" '
                               '(name VARCHAR(255), url VARCHAR(255), std VARCHAR(255))')
        self.db_cursor.execute('CREATE TABLE "cppreference.com" '
                               '(name VARCHAR(255), url VARCHAR(255), std VARCHAR(255))')

        try:
            self.add_url_filter('\.(jpg|jpeg|gif|png|js|css|swf|svg)$')
            self.set_follow_mode(Crawler.F_SAME_PATH)

            # cplusplus.com
            self.crawl('http://www.cplusplus.com/reference/')
            for name, url, std in self.results:
                self.insert_index('cplusplus.com', name, url, std)
            self.db_conn.commit()

            # Rename duplicate entries
            duplicates = self.db_cursor.execute('SELECT name, COUNT(name) '
                                                'AS NON '
                                                'FROM "cplusplus.com" '
                                                'GROUP BY NAME '
                                                'HAVING (NON > 1)').fetchall()
            for name, num in duplicates:
                dump = self.db_cursor.execute('SELECT name, url FROM '
                                              '"cplusplus.com" WHERE name="%s"'
                                              % name).fetchall()
                for n, u in dump:
                    if u not in self.name_exceptions:
                        n2 = n[5:] if n.startswith('std::') else n
                        try:
                            group = re.search('/([^/]+)/%s/$' % n2, u).group(1)
                        except Exception:
                            group = re.search('/([^/]+)/[^/]+/$', u).group(1)

                        new_name = '%s (%s)' % (n, group)
                        self.db_cursor.execute('UPDATE "cplusplus.com" '
                                               'SET name="%s", url="%s" '
                                               'WHERE url="%s"' %
                                               (new_name, u, u))
            self.db_conn.commit()

            # cppreference.com
            self.results = set()
            self.crawl('https://en.cppreference.com/w/cpp', '/w/cpp')

            for name, url, std in self.results:
                self.insert_index('cppreference.com', name, url, std)
            self.db_conn.commit()

        except KeyboardInterrupt:
            os.remove(environ.index_db_re)
            raise KeyboardInterrupt
        finally:
            self.db_conn.close()
951649
def append(self):
        """"""
        target_index = get_index_from_alias(self.alias_name)
        if not target_index:
            self.replace()
        else:
            self.index_all(target_index)
1061903
private void rehash() {
        int oldCapacity = mTable.length;
        Entry oldSet[] = mTable;

        int newCapacity = oldCapacity * 2 + 1;
        Entry newSet[] = new Entry[newCapacity];

        mModCount++;
        mThreshold = (int)(newCapacity * mLoadFactor);
        mTable = newSet;

        for (int i = oldCapacity ; i-- > 0 ;) {
            for (Entry old = oldSet[i] ; old != null ; ) {
                Entry e = old;
                old = old.mNext;

                // Only copy entry if its value hasn't been cleared.
                if (e.get() == null) {
                    mCount--;
                }
                else {
                    int index = (e.mHash & 0x7FFFFFFF) % newCapacity;
                    e.mNext = newSet[index];
                    newSet[index] = e;
                }
            }
        }
    }
586
protected void reallocateIndexes() {
        if (this.indexes == null || this.indexes.length != getFilteredModel().getSize()) {
            this.indexes = new int[getFilteredModel().getSize()];
        }
        applyConstraint();
    }
209979
public void rebuildIndexes(List<String> indexNames, I_CmsReport report) throws CmsException {

        try {
            SEARCH_MANAGER_LOCK.lock();
            Iterator<String> i = indexNames.iterator();
            while (i.hasNext()) {
                String indexName = i.next();
                // get the search index by name
                I_CmsSearchIndex index = getIndex(indexName);
                if (index != null) {
                    // update the index
                    updateIndex(index, report, null);
                } else {
                    if (LOG.isWarnEnabled()) {
                        LOG.warn(Messages.get().getBundle().key(Messages.LOG_NO_INDEX_WITH_NAME_1, indexName));
                    }
                }
            }
            // clean up the extraction result cache
            cleanExtractionCache();
        } finally {
            SEARCH_MANAGER_LOCK.unlock();
        }
    }
1371318
public void rebuildIndex(String index) throws Exception {

        OpenCms.getSearchManager().rebuildIndex(index, new CmsShellReport(m_cms.getRequestContext().getLocale()));
    }