-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from byng-systems/development_prefix_query
Development prefix query
- Loading branch information
Showing
5 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the "byng/pimcore-elasticsearch-plugin" project. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the LICENSE is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Byng\Pimcore\Elasticsearch\Query; | ||
|
||
/** | ||
* Prefix Query | ||
* | ||
* Allows to do prefix queries | ||
* | ||
* @author Asim Liaquat <[email protected]> | ||
*/ | ||
final class Prefix implements QueryInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $field; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $query; | ||
|
||
/** | ||
* Prefix constructor. | ||
* | ||
* @param string $field | ||
* @param string $query | ||
*/ | ||
public function __construct($field, $query) | ||
{ | ||
$this->field = $field; | ||
$this->query = $query; | ||
} | ||
|
||
/** | ||
* Get field | ||
* | ||
* @return string | ||
*/ | ||
public function getField() | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* Get query | ||
* | ||
* @return string | ||
*/ | ||
public function getQuery() | ||
{ | ||
return $this->query; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getType() | ||
{ | ||
return "prefix"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the "byng/pimcore-elasticsearch-plugin" project. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the LICENSE is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Byng\Pimcore\Elasticsearch\Query; | ||
|
||
/** | ||
* Regexp Query | ||
* | ||
* Allows to do regexp queries | ||
* | ||
* @author Asim Liaquat <[email protected]> | ||
*/ | ||
final class Regexp implements QueryInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $field; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $query; | ||
|
||
/** | ||
* Regexp constructor. | ||
* | ||
* @param string $field | ||
* @param string $query | ||
*/ | ||
public function __construct($field, $query) | ||
{ | ||
$this->field = $field; | ||
$this->query = $query; | ||
} | ||
|
||
/** | ||
* Get field | ||
* | ||
* @return string | ||
*/ | ||
public function getField() | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* Get query | ||
* | ||
* @return string | ||
*/ | ||
public function getQuery() | ||
{ | ||
return $this->query; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getType() | ||
{ | ||
return "regexp"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the "byng/pimcore-elasticsearch-plugin" project. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the LICENSE is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Byng\Pimcore\Elasticsearch\Query; | ||
|
||
/** | ||
* Wildcard Query | ||
* | ||
* Allows to do wildcard queries | ||
* | ||
* @author Asim Liaquat <[email protected]> | ||
*/ | ||
final class Wildcard implements QueryInterface | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $field; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $query; | ||
|
||
/** | ||
* Wildcard constructor. | ||
* | ||
* @param string $field | ||
* @param string $query | ||
*/ | ||
public function __construct($field, $query) | ||
{ | ||
$this->field = $field; | ||
$this->query = $query; | ||
} | ||
|
||
/** | ||
* Get field | ||
* | ||
* @return string | ||
*/ | ||
public function getField() | ||
{ | ||
return $this->field; | ||
} | ||
|
||
/** | ||
* Get query | ||
* | ||
* @return string | ||
*/ | ||
public function getQuery() | ||
{ | ||
return $this->query; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getType() | ||
{ | ||
return "wildcard"; | ||
} | ||
|
||
} |