Selaa lähdekoodia

Zend_search_Lucene: an ability to retrieve index generation number. Closes [ZF-9526].

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21639 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 16 vuotta sitten
vanhempi
commit
fcb5c2d6ac
1 muutettua tiedostoa jossa 15 lisäystä ja 0 poistoa
  1. 15 0
      library/Zend/Search/Lucene.php

+ 15 - 0
library/Zend/Search/Lucene.php

@@ -302,6 +302,21 @@ class Zend_Search_Lucene implements Zend_Search_Lucene_Interface
     }
     }
 
 
     /**
     /**
+     * Get generation number associated with this index instance
+     *
+     * The same generation number in pair with document number or query string
+     * guarantees to give the same result while index retrieving.
+     * So it may be used for search result caching.
+     *
+     * @return integer
+     */
+    public function getGeneration()
+    {
+        return $this->_generation;
+    }
+
+
+    /**
      * Get segments file name
      * Get segments file name
      *
      *
      * @param integer $generation
      * @param integer $generation