コード例 #1
0
        public IndexResult Update(string fileName, string text, DocumentIndexOptimizeSetup setup)
        {
            var characterIndexResult = _charactersIndex.Update(fileName, text, setup);
            var numberIndexResult    = _numberIndex.Update(characterIndexResult.DocNumber, text, setup);

            return(Merge(characterIndexResult, numberIndexResult));
        }
コード例 #2
0
        public IndexResult Update(int recordNumber, string text, DocumentIndexOptimizeSetup setup)
        {
            var charachterResult = _charactersIndex.Update(recordNumber, text, setup);
            var numberResult     = _numberIndex.Update(recordNumber, text, setup);

            return(Merge(charachterResult, numberResult));
        }
コード例 #3
0
        public IndexResult Rebuild(hOOt.Document document, bool deleteOld, DocumentIndexOptimizeSetup setup)
        {
            var characterIndexResult = _charactersIndex.Rebuild(document, deleteOld, setup);
            var numberIndexResult    = _numberIndex.Update(document.DocNumber, document.Text, setup);

            return(Merge(characterIndexResult, numberIndexResult));
        }
コード例 #4
0
 public IndexResult Index(int recordNumber, string text, DocumentIndexOptimizeSetup setup)
 {
     lock (_gate)
     {
         BornOrRessurectIfDead();
         UpdateVersion();
         return(_documentIndex.Index(recordNumber, text, setup));
     }
 }
コード例 #5
0
 public IndexResult Index(hOOt.Document document, bool deleteOld, DocumentIndexOptimizeSetup setup)
 {
     lock (_gate)
     {
         BornOrRessurectIfDead();
         UpdateVersion();
         return(_documentIndex.Index(document, deleteOld, setup));
     }
 }
コード例 #6
0
 public void Optimize(DocumentIndexOptimizeSetup setup)
 {
     lock (_gate)
     {
         BornOrRessurectIfDead();
         UpdateVersion();
         _documentIndex.Optimize(setup);
     }
 }
コード例 #7
0
 public IndexResult Update(string fileName, string text, DocumentIndexOptimizeSetup setup)
 {
     lock (_gate)
     {
         BornOrRessurectIfDead();
         UpdateVersion();
         return(_documentIndex.Update(fileName, text, setup));
     }
 }
コード例 #8
0
        public IndexResult Update(int recordNumber, string text, DocumentIndexOptimizeSetup setup)
        {
            if (!_isAlive)
            {
                return(new IndexResult());
            }
            UpdateLastUsedToken();
            var indexResult = _hoot.UpdateExistingIndex(recordNumber, text);

            Optimize(setup);
            return(indexResult);
        }
コード例 #9
0
        public IndexResult Update(string fileName, string text, DocumentIndexOptimizeSetup setup)
        {
            if (!_isAlive)
            {
                return(new IndexResult());
            }
            UpdateLastUsedToken();
            var indexResult = _hoot.UpdateIndex(fileName, text);

            Optimize(setup);
            return(indexResult);
        }
コード例 #10
0
        public IndexResult Index(hOOt.Document document, bool deleteOld, DocumentIndexOptimizeSetup setup)
        {
            if (!_isAlive)
            {
                return(new IndexResult());
            }
            UpdateLastUsedToken();
            var indexResult = _hoot.Index(document, deleteOld);

            Optimize(setup);
            return(indexResult);
        }
コード例 #11
0
        public IndexResult Rebuild(hOOt.Document document, bool deleteOld, DocumentIndexOptimizeSetup setup)
        {
            if (!_isAlive)
            {
                return(new IndexResult());
            }
            UpdateLastUsedToken();
            if (document.DocNumber > _hoot.DocumentCount - 1)
            {
                return(new IndexResult());
            }
            var indexResult = _hoot.UpdateIndex(document, deleteOld);

            Optimize(setup);
            return(indexResult);
        }
コード例 #12
0
 public void Optimize(DocumentIndexOptimizeSetup setup)
 {
     if (!_isAlive)
     {
         return;
     }
     _isOptimized = false;
     if (!setup.ShouldOptimize)
     {
         return;
     }
     UpdateLastUsedToken();
     if (!setup.ShouldDefer)
     {
         DoOptimize(setup.ShouldFreeMemory);
         return;
     }
     if (_optimizeHint.Advice())
     {
         DoOptimize(setup.ShouldFreeMemory);
     }
 }
コード例 #13
0
 public void Optimize(DocumentIndexOptimizeSetup setup)
 {
     _charactersIndex.Optimize(setup);
     _numberIndex.Optimize(setup);
 }