-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7d83bc
commit 9bf3cee
Showing
16 changed files
with
1,495 additions
and
23 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
plugins/arSolrPlugin/lib/arSolrAggregationFilter.class.php
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,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Access to Memory (AtoM) software. | ||
* | ||
* Access to Memory (AtoM) is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Access to Memory (AtoM) is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Access to Memory (AtoM). If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* arSolrAggregationFilter. | ||
*/ | ||
class arSolrAggregationFilter extends arSolrQuery | ||
{ | ||
public function __construct(string $name, $filter = null) | ||
{ | ||
if (null !== $filter) { | ||
$this->setFilter($filter); | ||
} | ||
} | ||
|
||
/** | ||
* Set the filter for this aggregation. | ||
* | ||
* @return $this | ||
*/ | ||
public function setFilter(arSolrTermQuery $filter): self | ||
{ | ||
return $this->setParam('filter', $filter); | ||
} | ||
} |
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,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Access to Memory (AtoM) software. | ||
* | ||
* Access to Memory (AtoM) is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Access to Memory (AtoM) is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Access to Memory (AtoM). If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* arSolrAggregationTerms. | ||
*/ | ||
class arSolrAggregationTerms extends arSolrQuery | ||
{ | ||
/** | ||
* Set the field for this aggregation. | ||
* | ||
* @param string $field the name of the document field on which to perform this aggregation | ||
* | ||
* @return $this | ||
*/ | ||
public function setField(string $field): self | ||
{ | ||
return $this->setParam('field', $field); | ||
} | ||
} |
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
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,116 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Access to Memory (AtoM) software. | ||
* | ||
* Access to Memory (AtoM) is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Access to Memory (AtoM) is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Access to Memory (AtoM). If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/** | ||
* arSolrNestedQuery. | ||
*/ | ||
class arSolrNestedQuery extends arSolrQuery | ||
{ | ||
public $query; | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->query = $this->setRawQuery(); | ||
} | ||
|
||
/** | ||
* Adds field to mlt query. | ||
* | ||
* @param string $path Nested object path | ||
* | ||
* @return $this | ||
*/ | ||
public function setPath(string $path): self | ||
{ | ||
return $this->setParam('path', $path); | ||
} | ||
|
||
/** | ||
* Sets nested query. | ||
* | ||
* @return $this | ||
*/ | ||
public function setQuery($query): self | ||
{ | ||
return $this->setParam('query', $query); | ||
} | ||
|
||
/** | ||
* Set score method. | ||
* | ||
* @param string $scoreMode options: avg, total, max and none | ||
* | ||
* @return $this | ||
*/ | ||
public function setScoreMode(string $scoreMode = 'avg'): self | ||
{ | ||
return $this->setParam('score_mode', $scoreMode); | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param string $ | ||
* | ||
* @return $this | ||
*/ | ||
public function addSort() | ||
{ | ||
return; | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param string $ | ||
* | ||
* @return $this | ||
*/ | ||
public function setSort() | ||
{ | ||
return; | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param string $ | ||
* | ||
* @return $this | ||
*/ | ||
public function setTerm() | ||
{ | ||
return; | ||
} | ||
|
||
/** | ||
* | ||
* | ||
* @param string $ | ||
* | ||
* @return $this | ||
*/ | ||
public function setFilter() | ||
{ | ||
return; | ||
} | ||
} |
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
Oops, something went wrong.