Merged in bugfix/HOR-3806 (pull request #6025)
HOR-3806 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -22,6 +22,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../../../gulliver/system/class.g.php';
|
||||||
|
require_once __DIR__ . '/../../../bootstrap/autoload.php';
|
||||||
|
require_once __DIR__ . '/../../../bootstrap/app.php';
|
||||||
|
|
||||||
// check script parameters
|
// check script parameters
|
||||||
// php reindex_solr.php workspacename [reindexall|reindexmissing|optimizeindex] [-skip 1005] [-reindextrunksize 1000]
|
// php reindex_solr.php workspacename [reindexall|reindexmissing|optimizeindex] [-skip 1005] [-reindextrunksize 1000]
|
||||||
// var_dump($argv);
|
// var_dump($argv);
|
||||||
@@ -117,7 +121,6 @@ if (! defined ('PATH_HOME')) {
|
|||||||
define( 'PATH_CLASSES', PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP );
|
define( 'PATH_CLASSES', PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP );
|
||||||
|
|
||||||
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "PATH_HOME: " . PATH_HOME . "\n";
|
print "PATH_HOME: " . PATH_HOME . "\n";
|
||||||
|
|||||||
@@ -24,8 +24,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function isEnabled($workspace)
|
public function isEnabled($workspace)
|
||||||
{
|
{
|
||||||
require_once('class.solr.php');
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
|
||||||
return $solr->isEnabled($workspace);
|
return $solr->isEnabled($workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,12 +39,6 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function getFacetsList($facetRequestEntity)
|
public function getFacetsList($facetRequestEntity)
|
||||||
{
|
{
|
||||||
require_once('class.solr.php');
|
|
||||||
require_once('entities/FacetGroup.php');
|
|
||||||
require_once('entities/FacetItem.php');
|
|
||||||
require_once('entities/SelectedFacetGroupItem.php');
|
|
||||||
require_once('entities/FacetResult.php');
|
|
||||||
|
|
||||||
// get array of selected facet groups
|
// get array of selected facet groups
|
||||||
$facetRequestEntity->selectedFacetsString = str_replace(',,', ',', $facetRequestEntity->selectedFacetsString);
|
$facetRequestEntity->selectedFacetsString = str_replace(',,', ',', $facetRequestEntity->selectedFacetsString);
|
||||||
// remove descriptions of selected facet groups
|
// remove descriptions of selected facet groups
|
||||||
@@ -98,7 +91,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
}
|
}
|
||||||
$facetRequestEntity->filters = $filters;
|
$facetRequestEntity->filters = $filters;
|
||||||
|
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// create list of facets
|
// create list of facets
|
||||||
$facetsList = $solr->getFacetsList($facetRequestEntity);
|
$facetsList = $solr->getFacetsList($facetRequestEntity);
|
||||||
@@ -206,7 +199,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
public function getNumberDocuments($workspace)
|
public function getNumberDocuments($workspace)
|
||||||
{
|
{
|
||||||
require_once('class.solr.php');
|
require_once('class.solr.php');
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// create list of facets
|
// create list of facets
|
||||||
$numberDocuments = $solr->getNumberDocuments($workspace);
|
$numberDocuments = $solr->getNumberDocuments($workspace);
|
||||||
@@ -220,7 +213,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function updateIndexDocument($solrUpdateDocumentEntity)
|
public function updateIndexDocument($solrUpdateDocumentEntity)
|
||||||
{
|
{
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// create list of facets
|
// create list of facets
|
||||||
$solr->updateDocument($solrUpdateDocumentEntity);
|
$solr->updateDocument($solrUpdateDocumentEntity);
|
||||||
@@ -233,7 +226,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function deleteDocumentFromIndex($workspace, $idQuery)
|
public function deleteDocumentFromIndex($workspace, $idQuery)
|
||||||
{
|
{
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// create list of facets
|
// create list of facets
|
||||||
$solr->deleteDocument($workspace, $idQuery);
|
$solr->deleteDocument($workspace, $idQuery);
|
||||||
@@ -245,7 +238,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function commitIndexChanges($workspace)
|
public function commitIndexChanges($workspace)
|
||||||
{
|
{
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// commit
|
// commit
|
||||||
$solr->commitChanges($workspace);
|
$solr->commitChanges($workspace);
|
||||||
@@ -257,7 +250,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function optimizeIndexChanges($workspace)
|
public function optimizeIndexChanges($workspace)
|
||||||
{
|
{
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
// commit
|
// commit
|
||||||
$solr->optimizeChanges($workspace);
|
$solr->optimizeChanges($workspace);
|
||||||
@@ -270,12 +263,8 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function getDataTablePaginatedList($solrRequestData)
|
public function getDataTablePaginatedList($solrRequestData)
|
||||||
{
|
{
|
||||||
require_once('class.solr.php');
|
|
||||||
require_once('entities/SolrRequestData.php');
|
|
||||||
require_once('entities/SolrQueryResult.php');
|
|
||||||
|
|
||||||
// execute query
|
// execute query
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
$solrPaginatedResult = $solr->executeQuery($solrRequestData);
|
$solrPaginatedResult = $solr->executeQuery($solrRequestData);
|
||||||
|
|
||||||
// get total number of documents in index
|
// get total number of documents in index
|
||||||
@@ -322,9 +311,7 @@ class BpmnEngineServicesSearchIndex
|
|||||||
*/
|
*/
|
||||||
public function getIndexFields($workspace)
|
public function getIndexFields($workspace)
|
||||||
{
|
{
|
||||||
require_once('class.solr.php');
|
$solr = new BpmnEngineSearchIndexAccessSolr($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
$solr = new BpmnEngine_SearchIndexAccess_Solr($this->_solrIsEnabled, $this->_solrHost);
|
|
||||||
|
|
||||||
$solrFieldsData = $solr->getListIndexedStoredFields($workspace);
|
$solrFieldsData = $solr->getListIndexedStoredFields($workspace);
|
||||||
// copy list of arrays
|
// copy list of arrays
|
||||||
|
|||||||
Reference in New Issue
Block a user