QueryEntry.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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-2008 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. */
  21. /** Zend_Search_Lucene_Index_Term */
  22. require_once 'Zend/Search/Lucene/Index/Term.php';
  23. /** Zend_Search_Lucene_Search_QueryEntry_Term */
  24. require_once 'Zend/Search/Lucene/Search/QueryEntry/Term.php';
  25. /** Zend_Search_Lucene_Search_QueryEntry_Phrase */
  26. require_once 'Zend/Search/Lucene/Search/QueryEntry/Phrase.php';
  27. /** Zend_Search_Lucene_Search_QueryEntry_Subquery */
  28. require_once 'Zend/Search/Lucene/Search/QueryEntry/Subquery.php';
  29. /**
  30. * @category Zend
  31. * @package Zend_Search_Lucene
  32. * @subpackage Search
  33. * @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
  34. * @license http://framework.zend.com/license/new-bsd New BSD License
  35. */
  36. abstract class Zend_Search_Lucene_Search_QueryEntry
  37. {
  38. /**
  39. * Query entry boost factor
  40. *
  41. * @var float
  42. */
  43. protected $_boost = 1.0;
  44. /**
  45. * Process modifier ('~')
  46. *
  47. * @param mixed $parameter
  48. */
  49. abstract public function processFuzzyProximityModifier($parameter = null);
  50. /**
  51. * Transform entry to a subquery
  52. *
  53. * @param string $encoding
  54. * @return Zend_Search_Lucene_Search_Query
  55. */
  56. abstract public function getQuery($encoding);
  57. /**
  58. * Boost query entry
  59. *
  60. * @param float $boostFactor
  61. */
  62. public function boost($boostFactor)
  63. {
  64. $this->_boost *= $boostFactor;
  65. }
  66. }