Count() public method

public Count ( ) : long
return long
Ejemplo n.º 1
0
        public Hoot(string indexPath, string fileName, Action <string> log, Action <string> logError, ITokensParser tokensParser, bool detailedTrace = false)
        {
            _path          = indexPath;
            _fileName      = fileName;
            _log           = log;
            _logError      = logError;
            _tokensParser  = tokensParser;
            _detailedTrace = detailedTrace;
            if (_path.EndsWith("\\") == false)
            {
                _path += "\\";
            }
            Directory.CreateDirectory(indexPath);
            Log("\r\n\r\n");
            Log("Starting....");
            Log(string.Format("Storage Folder = {0}{1}", _path, _fileName));
            _docs       = new StorageFile(_path + _fileName + ".docs", 4);
            _hash       = new Hash(_path + _fileName + ".idx", 255, 10, 1009);
            _lastDocNum = (int)_hash.Count();
            LoadWords();
            ReadDeleted();
            var bitmapPath = _path + _fileName + ".bitmap";

            _bitmapFile       = new FileStream(bitmapPath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
            _lastBitmapOffset = _bitmapFile.Seek(0L, SeekOrigin.End);
        }
Ejemplo n.º 2
0
 public Hoot(string indexPath, string fileName, Action <string> log, int minStringLengthToSearch = 2, int maxStringLengthIgnore = 60)
 {
     _path     = indexPath;
     _fileName = fileName;
     _minStringLengthToSearch = minStringLengthToSearch;
     _maxStringLengthIgnore   = maxStringLengthIgnore;
     _log = log;
     if (_path.EndsWith("\\") == false)
     {
         _path += "\\";
     }
     Directory.CreateDirectory(indexPath);
     _log("\r\n\r\n");
     _log("Starting hOOt....");
     _log(string.Format("Storage Folder = {0}{1}", _path, _fileName));
     _docs       = new StorageFile(_path + _fileName + ".docs", 4);
     _hash       = new Hash(_path + _fileName + ".idx", 255, 10, 1009);
     _lastDocNum = (int)_hash.Count();
     LoadWords();
     ReadDeleted();
     _bitmapFile       = new FileStream(_path + _fileName + ".bitmap", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
     _lastBitmapOffset = _bitmapFile.Seek(0L, SeekOrigin.End);
 }