Hi all, http://framework.zend.com/issues/browse/ZF-2055 this helped me with a solution.
Kranthi. http://goo.gl/e6t3 On 21 May 2012 13:40, Kranthi Krishna <[email protected]> wrote: > Hi all, > > I am trying to implement Zend_Search_Lucene in my ZF Application. > > $index = Zend_Search_Lucene::create(APPLICATION_PATH . > '/../data/tmp-index'); > $doc = new Zend_Search_Lucene_Document(); > $doc->addField(Zend_Search_Lucene_Field::Text('schoolId', > '15236489365')); > $doc->addField(Zend_Search_Lucene_Field::Text('title', 'Org Title')); > $index->addDocument($doc); > print_r($doc); > $hits = $index->find("Title"); > print_r($hits[0]->getDocument()); > > Is producing > > Zend_Search_Lucene_Document Object > ( > [_fields:protected] => Array > ( > [schoolId] => Zend_Search_Lucene_Field Object > ( > [name] => schoolId > [value] => 15236489365 > [isStored] => 1 > [isIndexed] => 1 // [1] > [isTokenized] => 1 > [isBinary] => > [storeTermVector] => > [boost] => 1 > [encoding] => > ) > > [title] => Zend_Search_Lucene_Field Object > ( > [name] => title > [value] => Org Title > [isStored] => 1 > [isIndexed] => 1 > [isTokenized] => 1 > [isBinary] => > [storeTermVector] => > [boost] => 1 > [encoding] => > ) > > ) > > [boost] => 1 > ) > Zend_Search_Lucene_Document Object > ( > [_fields:protected] => Array > ( > [schoolId] => Zend_Search_Lucene_Field Object > ( > [name] => schoolId > [value] => 15236489365 > [isStored] => 1 > [isIndexed] => 0 // [2] > [isTokenized] => 0 > [isBinary] => > [storeTermVector] => > [boost] => 1 > [encoding] => UTF-8 > ) > > [title] => Zend_Search_Lucene_Field Object > ( > [name] => title > [value] => Org Title > [isStored] => 1 > [isIndexed] => 1 > [isTokenized] => 1 > [isBinary] => > [storeTermVector] => > [boost] => 1 > [encoding] => UTF-8 > ) > > ) > > [boost] => 1 > ) > > can some one please explain me why [1] and [2] can be different ? of > course both of them represent the same document. id is unique through > out the application > > Kranthi. > http://goo.gl/e6t3
