storeDocs:       If true the documents themselves will be stored in the Indri index.
519329
private static void trueMain(String[] argv) throws Exception {
    if (argv.length != 1) {
      System.err.println("Please provide a params file as the sole command line argument");
      System.exit(-1);
    }
    final Parameters params = Parameters.loadSerifStyle(new File(argv[0]));

    final File outputDirectory = params.getCreatableDirectory("outputDirectory");
    final File corpusRoot = params.getExistingDirectory("corpusRoot");
    final int memory = params.getPositiveInteger("memoryInMB");
    final boolean storeDocs = params.getBoolean("storeDocs");
    final Predicate<File> fileFilter = getFileFilter(params);
    final IndriFileProcessor indriFileProcessor = params.getParameterInitializedObject(
        "indriFileProcessorClass", IndriFileProcessor.class);

    log.info("Building index for corpus {} format to {} using processor {}",
        corpusRoot, outputDirectory, indriFileProcessor.getClass().getName());

    final IndexEnvironment env = setupIndexer(outputDirectory, memory, storeDocs);

    recursiveIndex(corpusRoot, env, indriFileProcessor,
        fileFilter);
    log.info("Indexed {} documents", env.documentsIndexed());
    env.close();
    log.info("Index complete");
  }
559716
def sunionstore(self, dest, keys, *args):
        """"""
        result = self.sunion(keys, *args)
        self.redis[self._encode(dest)] = result
        return len(result)
689106
def init_index(self, app=None):
        """"""
        elasticindexes = self._get_indexes()

        for index, settings in elasticindexes.items():
            es = settings['resource']
            if not es.indices.exists(index):
                self.create_index(index, settings.get('index_settings'), es)
                continue
            else:
                self.put_settings(app, index, settings.get('index_settings').get('settings'), es)

            for mapping_type, mappings in settings.get('index_settings', {}).get('mappings').items():
                self._put_resource_mapping(mapping_type, es,
                                           properties=mappings,
                                           index=index, doc_type=mapping_type)
        return
1309077
def save_data(self, idx):
        """"""
        for name in self:
            actual = getattr(self, name)
            diskflag = getattr(self, '_%s_diskflag' % name)
            ramflag = getattr(self, '_%s_ramflag' % name)
            if diskflag:
                file_ = getattr(self, '_%s_file' % name)
                ndim = getattr(self, '_%s_ndim' % name)
                length_tot = 1
                for jdx in range(ndim):
                    length = getattr(self, '_%s_length_%s' % (name, jdx))
                    length_tot *= length
                if ndim:
                    raw = struct.pack(length_tot*'d', *actual.flatten())
                else:
                    raw = struct.pack('d', actual)
                file_.write(raw)
            elif ramflag:
                array = getattr(self, '_%s_array' % name)
                array[idx] = actual
800946
function _storeSupbookInternal()
    {
        $record    = 0x01AE;   // Record identifier
        $length    = 0x0004;   // Bytes to follow

        $header    = pack("vv", $record, $length);
        $data      = pack("vv", count($this->_worksheets), 0x0104);
        $this->_append($header . $data);
    }
454972
private int cordToIndex(int... cords)
    {
        if(cords.length != realIndexToCatIndex.length)
            throw new RuntimeException("Something bad");
        int index = 0;
        for(int i = 0; i < cords.length; i++)
        {
            index = cords[i] + dimSize[i]*index;
        }
        return index;
    }
822491
def index_file(self, f, overwrite=False):
        
        if isinstance(f, six.string_types):
            f = self.layout.get_file(f)

        if f.path in self.file_index and not overwrite:
            return

        if 'suffix' not in f.entities:  # Skip files without suffixes
            return

        md = self._get_metadata(f.path)

        for md_key, md_val in md.items():
            if md_key not in self.key_index:
                self.key_index[md_key] = {}
            self.key_index[md_key][f.path] = md_val
            self.file_index[f.path][md_key] = md_val
885394
function(index, updates) {
      var that = this;

      return this.readByIndex(index).then(function(doc) {
        return that._updateDoc(doc, updates);
      });
    }
1061872
private boolean lookForStore(int seen) {
        if (!OpcodeUtils.isStore(seen)) {
            return false;
        }

        storeReg = RegisterUtils.getStoreReg(this, seen);
        return true;
    }
816513
function() {
      var ids = [];
      // search localstorage for saved documents
      for ( var i = 0, max = localStorage.length; i < max; i++) {
        var key = localStorage.key(i);
        // value is a document if key confirms to prefix
        if (key.indexOf(prefix) == 0) {
          ids.push(key.substring(prefix.length));
        }
      }
      return ids;
    }
873448
@Override
	public boolean isStored() {

		if (isIdProperty()) {
			return true;
		}

		Indexed indexedAnnotation = getIndexAnnotation();
		return indexedAnnotation != null && indexedAnnotation.stored();
	}
1247599
def embeddedFileDel(self, name):
        """"""
        if self.isClosed or self.isEncrypted:
            raise ValueError("operation illegal for closed / encrypted doc")

        return _fitz.Document_embeddedFileDel(self, name)
707434
public function storeIndexingProperties()
    {
        $this->indexQueueIndexingPropertyRepository->removeByRootPidAndIndexQueueUid(intval($this->rootPageUid), intval($this->indexQueueUid));

        if ($this->hasIndexingProperties()) {
            $this->writeIndexingProperties();
        }

        $this->queueItemRepository->updateHasIndexingPropertiesFlagByItemUid($this->indexQueueUid, $this->hasIndexingProperties);
    }
721081
def ensure_index(self, index, mappings=None, settings=None, clear=False):
        
        mappings = mappings or []
        if isinstance(mappings, dict):
            mappings = [mappings]
        exists = self.indices.exists_index(index)
        if exists and not mappings and not clear:
            return
        if exists and clear:
            self.indices.delete_index(index)
            exists = False

        if exists:
            if not mappings:
                self.indices.delete_index(index)
                self.indices.refresh()
                self.indices.create_index(index, settings)
                return

            if clear:
                for maps in mappings:
                    for key in list(maps.keys()):
                        self.indices.delete_mapping(index, doc_type=key)
                self.indices.refresh()
            if isinstance(mappings, SettingsBuilder):
                for name, data in list(mappings.mappings.items()):
                    self.indices.put_mapping(doc_type=name, mapping=data, indices=index)

            else:
                from pyes.mappings import DocumentObjectField, ObjectField

                for maps in mappings:
                    if isinstance(maps, tuple):
                        name, mapping = maps
                        self.indices.put_mapping(doc_type=name, mapping=mapping, indices=index)
                    elif isinstance(maps, dict):
                        for name, data in list(maps.items()):
                            self.indices.put_mapping(doc_type=name, mapping=maps, indices=index)
                    elif isinstance(maps, (DocumentObjectField, ObjectField)):
                        self.put_mapping(doc_type=maps.name, mapping=maps.as_dict(), indices=index)

                return

        if settings:
            if isinstance(settings, dict):
                settings = SettingsBuilder(settings, mappings)
        else:
            if isinstance(mappings, SettingsBuilder):
                settings = mappings
            else:
                settings = SettingsBuilder(mappings=mappings)
        if not exists:
            self.indices.create_index(index, settings)
            self.indices.refresh(index, timesleep=1)
1336031
private void recordIndex(int index) {
        stateLock.writeLock().lock();
        try {
            int insertionPoint = -Arrays.binarySearch(effectiveIndex, index) - 1;
            System.arraycopy(effectiveIndex, insertionPoint, effectiveIndex, insertionPoint + 1, effectiveIndex.length - insertionPoint - 1);
            effectiveIndex[insertionPoint] = index;
        } finally {
            stateLock.writeLock().unlock();
        }
    }
870089
void store(Index.IndexSpace indexSpace) throws IOException {
      this.offset = indexSpace.offset;
      this.occupiedSpace = indexSpace.length;
      ByteBuffer buffer = ByteBuffer.allocate(length());
      buffer.putShort((short) prefix.length);
      buffer.put(prefix);
      byte flags = 0;
      if (innerNodes != null && innerNodes.length != 0) {
         flags |= HAS_NODES;
      } else if (leafNodes != null && leafNodes.length != 0) {
         flags |= HAS_LEAVES;
      }
      buffer.put(flags);
      buffer.putShort((short) keyParts.length);
      for (byte[] keyPart : keyParts) {
         buffer.putShort((short) keyPart.length);
         buffer.put(keyPart);
      }
      if (innerNodes != null) {
         for (InnerNode innerNode : innerNodes) {
            buffer.putLong(innerNode.offset);
            buffer.putShort(innerNode.length);
         }
      } else {
         for (LeafNode leafNode : leafNodes) {
            buffer.putInt(leafNode.file);
            buffer.putInt(leafNode.offset);
            buffer.putShort(leafNode.numRecords);
         }
      }
      buffer.flip();
      segment.getIndexFile().write(buffer, offset);

      if (trace) {
         log.tracef("Persisted %08x (length %d, %d %s) to %d:%d", System.identityHashCode(this), length(),
            innerNodes != null ? innerNodes.length : leafNodes.length,
            innerNodes != null ? "children" : "leaves", offset, occupiedSpace);
      }
   }
967608
private void saveFeatureIndexes(FeatureIndex[] index, String outputDir) throws IOException
	{
		logger.info("");

		// save the indexes
		for (int i=0;i<index.length;i++)
		{
			logger.debug("dic" + i + " size " + index[i].size());

			File tmp = new File(outputDir + "dic" + i);
			//File tmp = File.createTempFile("dic" + i, null);
			//tmp.deleteOnExit();

			BufferedWriter bwd = new BufferedWriter(new FileWriter(tmp));
			index[i].write(bwd);
			bwd.close();

			// add the dictionary to the model
			//model.add(tmp, "dic" + i);
		} // end for
	}