PageRenderTime 178ms CodeModel.GetById 71ms app.highlight 9ms RepoModel.GetById 92ms app.codeStats 0ms

/inc/lib/Zend/Search/Lucene/Search/Query/Insignificant.php

https://bitbucket.org/yoander/mtrack
PHP | 139 lines | 40 code | 13 blank | 86 comment | 0 complexity | a1d80c0761e1a9e105bea33455b5ba2b MD5 | raw file
  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-2011 Zend Technologies USA Inc. (http://www.zend.com)
 19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 20 * @version    $Id: Insignificant.php 23775 2011-03-01 17:25:24Z ralph $
 21 */
 22
 23
 24/** Zend_Search_Lucene_Search_Query */
 25require_once 'Zend/Search/Lucene/Search/Query.php';
 26
 27
 28/**
 29 * The insignificant query returns empty result, but doesn't limit result set as a part of other queries
 30 *
 31 * @category   Zend
 32 * @package    Zend_Search_Lucene
 33 * @subpackage Search
 34 * @copyright  Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
 35 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 36 */
 37class Zend_Search_Lucene_Search_Query_Insignificant extends Zend_Search_Lucene_Search_Query
 38{
 39    /**
 40     * Re-write query into primitive queries in the context of specified index
 41     *
 42     * @param Zend_Search_Lucene_Interface $index
 43     * @return Zend_Search_Lucene_Search_Query
 44     */
 45    public function rewrite(Zend_Search_Lucene_Interface $index)
 46    {
 47        return $this;
 48    }
 49
 50    /**
 51     * Optimize query in the context of specified index
 52     *
 53     * @param Zend_Search_Lucene_Interface $index
 54     * @return Zend_Search_Lucene_Search_Query
 55     */
 56    public function optimize(Zend_Search_Lucene_Interface $index)
 57    {
 58        return $this;
 59    }
 60
 61    /**
 62     * Constructs an appropriate Weight implementation for this query.
 63     *
 64     * @param Zend_Search_Lucene_Interface $reader
 65     * @return Zend_Search_Lucene_Search_Weight
 66     */
 67    public function createWeight(Zend_Search_Lucene_Interface $reader)
 68    {
 69        require_once 'Zend/Search/Lucene/Search/Weight/Empty.php';
 70        return new Zend_Search_Lucene_Search_Weight_Empty();
 71    }
 72
 73    /**
 74     * Execute query in context of index reader
 75     * It also initializes necessary internal structures
 76     *
 77     * @param Zend_Search_Lucene_Interface $reader
 78     * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter
 79     */
 80    public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null)
 81    {
 82        // Do nothing
 83    }
 84
 85    /**
 86     * Get document ids likely matching the query
 87     *
 88     * It's an array with document ids as keys (performance considerations)
 89     *
 90     * @return array
 91     */
 92    public function matchedDocs()
 93    {
 94        return array();
 95    }
 96
 97    /**
 98     * Score specified document
 99     *
100     * @param integer $docId
101     * @param Zend_Search_Lucene_Interface $reader
102     * @return float
103     */
104    public function score($docId, Zend_Search_Lucene_Interface $reader)
105    {
106        return 0;
107    }
108
109    /**
110     * Return query terms
111     *
112     * @return array
113     */
114    public function getQueryTerms()
115    {
116        return array();
117    }
118
119    /**
120     * Query specific matches highlighting
121     *
122     * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter  Highlighter object (also contains doc for highlighting)
123     */
124    protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter)
125    {
126        // Do nothing
127    }
128
129    /**
130     * Print a query
131     *
132     * @return string
133     */
134    public function __toString()
135    {
136        return '<InsignificantQuery>';
137    }
138}
139