When the runs a
query, each document in the index is ranked based on how many of the requested keywords are in the
document. The results are then displayed in order with (hopefully) the most useful at the top
8.2 Introducing Zend_Search_Lucene
The Zend Framework??™s search component, Zend_Search_Lucene is a very powerful tool. It is a full text search
engine that is based on the popular Apache Lucene project which is a search engine for Java. The index files
created by Zend_Search_Lucene are compatible with Apache Lucene and hence any of the index management
utilities written for Apache Lucene will work with Zend_Search_Lucene too.
Licensed to Menshu You
Please post comments or corrections to the Author Online forum at
http://www.manning-sandbox.com/forum.jspa?forumID=329
Zend_Search_Lucene creates an index of documents. The documents are each instances of
Zend_Search_Lucene_Document. Each document contains Zend_Search_Lucene_Field objects which contain
the actual data. A visual representation is shown in Figure 8.1.
Figure 8.1 A Zend_Search_Lucene index consists of multiple documents, each containing multiple fields. Not all fields are stored and
some fields may contain data for display rather than searching.
Queries can then the issues against the index and an ordered array of results (each of type
Zend_Search_Lucene_Search_QueryHit) is returned.
Pages:
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213