$v) { // add the document $doc = new Zend_Search_Lucene_Document(); $doc->addField(Zend_Search_Lucene_Field::Text('myDocumentIdentifier', $k)); $doc->addField(Zend_Search_Lucene_Field::Text('myDocumentContent', $v)); $index->addDocument($doc); } print "done
\n"; unset($index); } // updates the index function updatedIndex($indexPath) { static $pass = 1; print "Updating index pass $pass... "; $index = Zend_Search_Lucene::open($indexPath); $data = getIndexablePseudoData(); foreach($data as $k=>$v) { // do a seach and delete the doc from the index based on its 'myDocumentIdentifier' $term = new Zend_Search_Lucene_Index_Term($k, 'myDocumentIdentifier'); $query = new Zend_Search_Lucene_Search_Query_Term($term); $hits = $index->find($query); foreach ($hits as $hit) { $index->delete($hit->id); } // add the document $doc = new Zend_Search_Lucene_Document(); $doc->addField(Zend_Search_Lucene_Field::Text('myDocumentIdentifier', $k)); $doc->addField(Zend_Search_Lucene_Field::Text('myDocumentContent', $v)); $index->addDocument($doc); } print "done
\n"; unset($index); $pass++; } // pseudo-documents to index function getIndexablePseudoData() { $data = array ( 1=>'REEMSW EBKRMS UBZOMGLNGKJTRXSGL', 2=>'GGWRHX LZZB NBJ QNHOMDG A', 13=>'QBJ RNHOMDG IBN LZZBZGGA', 35=>'GGWRHX LZZB NBJ QNHOMDG L', 62=>'GGWRHX LZZB NBJ QNHOMDG G', 99=>'GGWRHX LZZB NBJ QNHOMDG V', 100=>'RAHP R JMW WBRL', 101=>'BBJ ZRHKMTTRS PGX IBJ SB TBSWGN CBNPU', 102=>'BLZZ NGJBBLGE MLUGTI UZBSLRSGBAUTX', 103=>'ISULRTT SGC EM RL NGHGZLMBS', 104=>'KNBAJTGUOBBL JRHPAZ ZNBJTGKU CMLO VRATLAGBREGNA', 105=>'PGZTBX ZU SFHORSWG LZZG UBTALMBS', 106=>'RMF MUUAGU CMLO WAWO ZRWGGU OBKG EM RSE TRZLBZ', 107=>'RMF ZNBJTGK CMLO NGKBLG RHHGUU LB GKRMT', 108=>'SDRTARLG PGUPLBZUMLGU XBSGHL UBTALMBS', 109=>'ISULRTT CMNGTGUU LIM IBN KGNNX TRWG', 110=>'MBSIMWANG IRMTBDGN MSLGNSGL CMLO SGC UORC TMSG', 111=>'MAULBKMYG ZRFMKMYGN CMLO BZZBNLASMLMGU RSE HAULBK IBNKU', 112=>'ISWGSMAK KBEMIX NGKBLG RHHGUU JGLCGGS UMLGU', 113=>'KGUL EGZTBX SGLCBNP KRSRWGKGSL UBTALMBS', 114=>'GBBP MSLB ZGNKMUUMBSU MUUAG', 115=>'QEE GDGSL NGWMULNRLMBS LB UGHANGHMKHRHR', 116=>'ZBEMIX PLU IBN OGSENMHPUBSZOBLBHBK', 117=>'SDRTARLG ULMTTUGHANG ULNRLRTARNE', 118=>'SDRTARLG ULMTTUGHANG VQZ', 119=>'UTBC TBWMSU LB LULBBZ', 120=>'UGLAZ EMHRUR BS NGHGZLMBS EM RL TDIG PKO', 121=>'PBHAKGSL HBSIMWANRLMBSUGLAZ WAMEG IBN ERHUOSG', 122=>'MTGRS AZ PLU', 123=>'MTGRS AZ RMNGZRUU', 124=>'MTGRS AZ KRSRWGE IMNGCRTT SGLCBNP', 125=>'PGZTBX CGJOBULZC LB RAUGZBMSL', 126=>'ZMUH CBNP LB JG EBSG', 127=>'LGLCBNP QEKMS LZZBZXAX', 128=>'MPBL SHZ RGRLANG KNRHPGN', 129=>'UGLAZ BIIMHG IMNGCRTT IBN IRMTBDGN', 130=>'ZMUH IUUAGU QAWAUL LZZB', 131=>'YZWNREG ZRFMKMYGN', 132=>'UBILCRNG ISULRTTU', 133=>'QEE CGNBF ZNMSLGN LB MREULNGRK CBNPULRLMBS', 134=>'MTGRS AZ SGLCBNP NBBK', 135=>'HBBT', 136=>'LGUL QBJ', 137=>'LGUL L', 138=>'HBBT', 139=>'BP', 140=>'RUWE', 141=>'RUEWI', 142=>'BLZABLZZ TBC BS EMUP UZRHG', 143=>'PGTGLGE IMTG SGGE LB NGHBDGN INBK JRHPAZ', 144=>'MORSWG PLU IBN HTMGSL PRXKGGPHGSLNGHBK', 145=>'JAGULMBS RJBAL ZNBLGHLMBS RWRMSUL TRLGUL CBNK', 146=>'LGLCBNP QEKMS LZZBZX', 147=>'ZMUH CBNP LB JG EBSG', 148=>'ISULRTT LUBTK RL HBJ ZRWGGU OBAUG', 149=>'ONEGN YTLNMAK L LRZGU NRTGU IBN LRZG TMJNRNX', 150=>'MTGRS AZ KRSRWGE UGNDGN SGLCBNP', 151=>'MTGRS AZ JRHPAZ SGLCBNP', 152=>'LGLCBNP KRSRWGKGSL ULRLMBS', 153=>'QUUGL LRW RTT GVAMZKGSL MS ERLR HGSLGNU', 154=>'DBNP CMLO ZHI LGRK LB KBDG RNHOMDMSW LB ERHUOSG', 155=>'MOGHP RSE IMF NRUBSU GKRMT', 156=>'MRTT KMK IBTTBC AZ BS LBEB MLGKU', 157=>'ZMUH CBNP IBN SBNLOUOBNGOBKGHR', 158=>'HSBTV ERLR HSKU SBL CBNPMSW', 159=>'RMTT MS MPBL SHZ RJJNGDMRLMBSU IBN MAULBKGNU', 160=>'MOGHP BAL HBBTSGUU BI LOG SGC SHZ PBKRMSU IGRLANG', 161=>'MBSIMWANG GNKHEBLHR', 162=>'HGHBDGN ERLR INBK ZRLL ZRWGGU EM', 163=>'MNGRLGE PLU GSLNX IBN DRSHBADGNXBALOHR', 164=>'QEE ZU UJG HTMGSL VAGNX RSRTXYGN LB BLZA', 165=>'ONEGN MSULRTT KNGSEZMHNB HBKZGLMLMDG AZWNREG', 166=>'EBUUMJTG ZNBJTGK CMLO PGNKRTUGND', 167=>'QEE TBBWTG KRZU IASHLMBSRTMLX', 168=>'BRHPAZ KRMSLRSGSHG', 169=>'QUUMUL CMLO MSULRTTRLMBS BI EMU BS SGLCBNP', 170=>'WGRNLJGRL IMFGU', 171=>'MRSSBL EB PIMOZ ZMSW INBK MPM QNHOMDG LB HBALGN', 172=>'PGRE ORNE ENMDG BS IMTGZNMSL UGNDGN', 173=>'MBSDGNL HMHOKBSEU UUG KRULGN WNBAZ LB PGNKRTTM', 174=>'RRFGU RNG SBL UGSEMSW LONBAWO ZU IRF UGNDGN', 175=>'GBBP MSLB KBASLMSW MUUAG CMLO LRU BS HEHZRHUBSG', 176=>'ONEGN GVAMZKGSL IBN HBJ XSBF', 177=>'DBNPULRLMBS UGLAZ', 178=>'ZRXR N YZWNREGU', 179=>'HGSEGNRTBRLMSW GMHGSUGU', 180=>'MTGRS AZ RMNGZRUU UGLAZ IBN TNGW', 181=>'TGSGNRT IUUAGU', 182=>'ZRSARTTX ASMSULRTT IRATLX DGNUMBSU BI MPBL SNKUAZZBNLQWGSL', 183=>'JAMHPJBBPU HRSSBL BZGS HBKRSX IMTG', 184=>'MNGRLG RHHBASL IBN QSWGTR BBOS', 185=>'QUUMUL CMLO SGCUTGLLGN JTRUL', 186=>'OZGS IMNGCRTT ZBNLU IBN TRY LGULMSW', 187=>'UGLAZ UZKE RSE EOEG RHHGUU IBN NGII', 188=>'ONEGN RSE MSULRTT SGC RBNLMTRLG IMNGCRTT', 189=>'MBSIMWANG JRHPAZ QBJ', 190=>'MBSIMWANG JRHPAZ QBJ', 191=>'ENBDMUMBS RSE HBSIMWANG LU BTK IBN HBJ XSBF', 192=>'TGL IE ZOBSG UGLAZ IBN NRKGU', 193=>'YZWNREG EQMUOSG LB GAC', 194=>'MRSSBL RHHGUU ENGENGUU IMTGU', 195=>'ISULRTTHBSIMWANG UBILCRNG BS RZZTMHRLMBS UGNDGN', 196=>'ZMUH MUUAGU CMLO WRNEGGZ XMK L XRKM', 197=>'RMNGCRTTUGHANMLX HRE IBN YSMDGNUMLX BI ZRSMLBJR', 198=>'BRNNRHAER MSULRTT IBN EOBLBMORSSGT', 199=>'PGRE LGLUHNGGS IMNGCRTT SGGEU LB JG NGZTRHGEIMFGE', 200=>'GBBP MSLB COX EMWGBSU SFHORSWG JRHPAZ MUSL CBNPMSW', 201=>'MBSIMWANG ZNMSLGN IBN MONMULMG', 202=>'YZERLG KMGN L HTMGSL MSIBNKRLMBS', 203=>'ISULRTT ZRLHO ZRSGT RSE HTGRS AZ HRJTMSW RL BPRXU OBAUG', 204=>'UGLAZ GKRMT RHHBASL IBN XRKM XBUPM', 205=>'ONEGN NGKBLG RWGSL IBN BLZZ', 206=>'MBSIMWANG RSE MSULRTT MMUHB LXAA NBALGNU', 207=>'MBSIMWANG RSE MSULRTT MMUHB GBCZ UCMLHOGU', 208=>'MNGRLG JRHPAZ QBJ IBN UGNDGNA', 209=>'BRHPAZ RAEML IBN QAWAULR', 210=>'MNGRLG UMKZTG JAL NBJAUL ZXUJG HNBS JRHPAZ UHNMZL', 211=>'UGLAZ UGHANG OLLZUQBSHEBLHR BS ZBZG', 212=>'LKE UGNDGN MUUAGU', 213=>'YZERLG IMNKCRNG BS QBRSSROBKGIC', 214=>'ZMUH', 215=>'DMSEBCU BN NRDR AZERLGU', 216=>'LGLCBNP QEKMS LZZBZM', 217=>'HGHBSIMWANG DMNLART LRZG TMJNRNX LB KRF HRZRHMLX', 218=>'MNGRLG SGC BZZTB DMNLART LRZG TMJNRNX', 219=>'UGLAZ NGEASERSL MSLGNSGL CMLO UORC HREMRSL', 220=>'ISULRTT LQU EGDMHG RL TDIG JANSRJX', 221=>'QEE WCMTNPSBFIC LB EGDMHGU', 222=>'ENBJTGK CMLO ZNMSLMSW INBK ZMHORGT MS URTGU', 223=>'ENBJTGK CMLO VARNRSLMSG BRNNRHAER', 224=>'YUGNU HBKZTRMS BI UTBCSGUU', 225=>'UGLAZ ZD OBKG CMLO RHHGUU LB SFHORSWG', 226=>'HZQ SFRJXLG ERHPGLGBREGN', 227=>'ZMUH', 228=>'EOBLBHORSSGT BZGS AZ HPE ZBNL BS EJZZA', 229=>'MNGRLG R LGRUGN UUGVEL RHHBASL IBN EOBLBHORSSGT', 230=>'MBSIMWANG RNRSPU GRZLBZ', 231=>'BZKRSRWGN BS CMSGL', 232=>'LGLCBNP EBHAKGSLRLMBS', 233=>'UGLAZ R WGSGNMH REKMS RHHBASL BS SGC NGHGZLMBS EM', 234=>'RMF NGUBTALMBS RSE LGFL UMYG IBN ERATMSG IBN OGN GXGU', 235=>'HGKBDG UQV INBK MTMGSL DBNPULRLMBSU', 236=>'YZWNREG LGLVRATL BS VRATLA', 237=>'GBBP MSLB MNXZLBHRNE MUUAG RSE NGUBTDG', 238=>'GBBP MSLB RHHGUU ZGNKMUUMBSU IBN MBSDGEMR BS RMNGZRUU', 239=>'ISULRTT KSBTBUGRNHO IASHLMBSU IBN EWE', 240=>'ONEGN MSULRTT L PGTT OZLMETGF UXULGKU', 241=>'YZERLG QPZRXR MNRUOGU', 242=>'GBBP MSLB OALTBBP ZNBJTGK BS IRSU GRZLBZ', 243=>'UTBCSGUU MUUAGU BS ZU PB HTAULGN', 244=>'EJZZA ZAJTMH MSLGNIRHG SGGEU LB JG NASSMSW RL ATJ', 245=>'PGZTBX XBSGHL UBTALMBS', 246=>'MBKG AZ MP JANSMSW UBTALMBS IBN ZGTMUUR', 247=>'HGUGL ZRUUCBNE BS GXSSU TRZLBZ', 248=>'MUM SGLCBNP HBSIMW EBHAKGSL', 249=>'MPM SGLCBNP HBSIMW EBHAKGSL', 250=>'GM SGLCBNP HBSIMW EBHAKGSL', 251=>'GMY DBSW HRSSBL RHHGUU GKRMT ZNBZGNTX INBK OBKG', 252=>'ISULRTT ZU UJG BRPJBSG ZTAWMS RSE HBSIMWANG QBJU', 253=>'GOG SGLCBNP HBSIMW EBHAKGSL', 254=>'UMLG ZTRS', 255=>'AZERLG UGNDGN MSIBNKRLMBS', 256=>'DGJUMLG RSE JAUMSGUU BDGNORAT', 257=>'QEE PLU IBN LORSPXBAIBBEUHBK', 258=>'UCMLHO TGEWGNUBSTMSGHBK CGJUMLG LB SGC OBUL', 259=>'UHM SGLCBNP HBSIMW EBHAKGSL', 260=>'ZD SGLCBNP HBSIMW EBHAKGSL', 261=>'UGLAZ PLU GSLNX IBN UMBJORSEBOGNLXHBK', 262=>'MNGRLG SGC RHHBASLU', 263=>'DMSEBCU UGNDGN AZERLGU', 264=>'PLU GSLNX', 265=>'PLUSFHORSWG HORSWGU', 266=>'EOBLBHORSSGT CGJUGNDGNU RNG LMKMSW BAL LB EJZZA', 267=>'HGKBLG RHHGUU', 268=>'QUUMUL CMLO SGCUTGLLGN JTRUL LZZBZMAG', 269=>'TNGW HRSSBL ZNMSL BN URDG NGZBNLU LB EPR CMLO BAL JAMHPJBBPU HNRUOMSW', 270=>'ZBEMIX UOGMTR ULAGHPU ZRUUCBNE UGLLMSWU', 271=>'ISWGSMAK LGLUHNGGS EGZTBXKGSL', 272=>'SCRHL LGLUHNGGS EGZTBXKGSL', 273=>'CBNPULRLMBS RSE TRZLBZ MSULRTTRLMBS', 274=>'MBSIMWANG XGTBCSR IBN ZRFMKMYGN RSE RTGFF QHHGUU', 275=>'PWME LGULMSW', 276=>'MBSSGHLMDMLX MUUAGU', 277=>'MNGRLG UUGVEL LGRUGN RHHBASL IBN TTGSL RL ISWGSMAK', 278=>'TGSGNRT IUUAGU', 279=>'SFHORSWG ERLRJRUG HTGRSAZ', 280=>'UGSE JMTTMSW IBN GDGNXLOMSW AZ LB UGZL A', 281=>'PB AZERLGU LB ORNDGXPRNEBUHBK INBK QKX', 282=>'DBNPULRLMBS ZMWNRLMBS ENBQGHL', 283=>'ZMUH MUUAGU CMLO CGNBF ZNMSLGN', 284=>'ENBJTGK CMLO EBHLBN HBKZALGN', 285=>'EOBSG UXULGK ENBZU HRTTU RILGN OBANU RSXLOMSW JAL FL', 286=>'SKRMT JTRULU', 287=>'ZRFMKMYGN EBULYZWNREG IUUAGU', 288=>'ISULRTT UMKZTX QHHBASLMSW BS CBNPULRLMBS', 289=>'LU HBSIMWANRLMBS IBN VGNMHOMZ MBNZ', 290=>'MBSIMWANG JRHPAZ QBJ IBN ZRFMKMYGN', 291=>'EBULZMWNRLMBS IUUAGU', 292=>'ISULRTT KNGSE MBSIMWANG XGTBCSR GRZLBZ', 293=>'UKRTT ORNE ENMDGU MS UBKG EMU'); return $data; }