Prev | Current Page 206 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

jspa?forumID=329
implies that for an advanced search system that most websites provide, a hybrid approach would be used.
We??™ll explore that a little later. Let??™s look first at the query parser for strings.
String queries
All search engines provide a very simple search interface for their users: a single text field. This makes it
very easy to use, but at first glance seems to make it harder to provide a complex query. Like Google,
Zend_Search_Lucene has a query parser that can interpret what is typed into a single text field into a powerful
query. When you pass in a string to the find() function, behind the scenes the function
Zend_Search_Lucene_Search_QueryParser::parse() is called. This class implements the Lucene query parser
syntax as supported by v 2.0 of Apache Lucene.
To do its work, the parser breaks down the query into terms, phrases and operators. A term is a single
word and a query is multiple words grouped using quotation marks, such as ???hello world???. An operator is a
boolean word (such as AND) or symbol modified used to provide more complex queries. Wildcards are also
supported using the asterisk and question mark symbols. A question mark is used to represent a single
character and the asterisk represents several characters. For instance searching for frame* will find frame,
framework, frameset and so on.


Pages:
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
doktorat lampy ogrodowe określić zakłady bukmacherskie Wczasy nad morzem