import
[web.mtrack] / inc / lib / Zend / Search / Lucene / Search / QueryEntry / Subquery.php
1 <?php
2 /**
3  * Zend Framework
4  *
5  * LICENSE
6  *
7  * This source file is subject to the new BSD license that is bundled
8  * with this package in the file LICENSE.txt.
9  * It is also available through the world-wide-web at this URL:
10  * http://framework.zend.com/license/new-bsd
11  * If you did not receive a copy of the license and are unable to
12  * obtain it through the world-wide-web, please send an email
13  * to license@zend.com so we can send you a copy immediately.
14  *
15  * @category   Zend
16  * @package    Zend_Search_Lucene
17  * @subpackage Search
18  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
20  * @version    $Id: Subquery.php 16971 2009-07-22 18:05:45Z mikaelkael $
21  */
22
23 /** Zend_Search_Lucene_Index_Term */
24 require_once 'Zend/Search/Lucene/Index/Term.php';
25
26 /** Zend_Search_Lucene_Search_QueryEntry */
27 require_once 'Zend/Search/Lucene/Search/QueryEntry.php';
28
29 /**
30  * @category   Zend
31  * @package    Zend_Search_Lucene
32  * @subpackage Search
33  * @copyright  Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
34  * @license    http://framework.zend.com/license/new-bsd     New BSD License
35  */
36 class Zend_Search_Lucene_Search_QueryEntry_Subquery extends Zend_Search_Lucene_Search_QueryEntry
37 {
38     /**
39      * Query
40      *
41      * @var Zend_Search_Lucene_Search_Query
42      */
43     private $_query;
44
45     /**
46      * Object constractor
47      *
48      * @param Zend_Search_Lucene_Search_Query $query
49      */
50     public function __construct(Zend_Search_Lucene_Search_Query $query)
51     {
52         $this->_query = $query;
53     }
54
55     /**
56      * Process modifier ('~')
57      *
58      * @param mixed $parameter
59      * @throws Zend_Search_Lucene_Search_QueryParserException
60      */
61     public function processFuzzyProximityModifier($parameter = null)
62     {
63         require_once 'Zend/Search/Lucene/Search/QueryParserException.php';
64         throw new Zend_Search_Lucene_Search_QueryParserException('\'~\' sign must follow term or phrase');
65     }
66
67
68     /**
69      * Transform entry to a subquery
70      *
71      * @param string $encoding
72      * @return Zend_Search_Lucene_Search_Query
73      */
74     public function getQuery($encoding)
75     {
76         $this->_query->setBoost($this->_boost);
77
78         return $this->_query;
79     }
80 }