Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace CirrusSearch\Query; |
| 4 | |
| 5 | use CirrusSearch\Search\SearchContext; |
| 6 | |
| 7 | /** |
| 8 | * Parse a cirrus fulltext search query and build an elasticsearch query. |
| 9 | */ |
| 10 | interface FullTextQueryBuilder { |
| 11 | /** |
| 12 | * Build a query for supplied term. |
| 13 | * |
| 14 | * The method will setup the query and accompanying environment within |
| 15 | * the supplied context. |
| 16 | * |
| 17 | * TODO: right now, this code does two separate things, parsing $term |
| 18 | * and building query from parsed structure. We may want to split this |
| 19 | * into separate actions, to allow other query builders to benefit from parsing |
| 20 | * stage but override building stage. |
| 21 | * |
| 22 | * @param SearchContext $searchContext |
| 23 | * @param string $term term to search |
| 24 | */ |
| 25 | public function build( SearchContext $searchContext, $term ); |
| 26 | |
| 27 | /** |
| 28 | * Attempt to build a degraded query from the query already built into $context. Must be |
| 29 | * called *after* self::build(). |
| 30 | * |
| 31 | * @param SearchContext $searchContext |
| 32 | * @return bool True if a degraded query was built |
| 33 | */ |
| 34 | public function buildDegraded( SearchContext $searchContext ); |
| 35 | } |