BUG-13543: Some cases are showing triplicated in inbox using SOLR SOLVED
- Al utilizar solr y ver los listados de casos se podian observar casos repetidos. - Se produjo un error al momento de actualizar un registro en solr ya que los datos que se tenian habian caracteres extraños los cuales rompian el xml. - Se valido la formacion del XML añadiendo las etiquetas CDATA y eliminando caracteres extraños, en la class.AppSolr en la funcion buildSearchIndexDocumentPMOS2. - en el caso especifico de la bbdd se descubrio que en los casos que se reproducia el problema la tareas con las que se ponian no existian debido a que era un proceso antiguo. se recomienda cambiar los uid hacia el nuevo uid de la tarea actual.
This commit is contained in:
@@ -518,8 +518,6 @@ class AppSolr
|
|||||||
'includeCols' => $columsToIncludeFinal,
|
'includeCols' => $columsToIncludeFinal,
|
||||||
'resultFormat' => 'json'
|
'resultFormat' => 'json'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
$solrRequestData = Entity_SolrRequestData::createForRequestPagination ($data);
|
$solrRequestData = Entity_SolrRequestData::createForRequestPagination ($data);
|
||||||
// use search index to return list of cases
|
// use search index to return list of cases
|
||||||
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
$searchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
@@ -622,7 +620,6 @@ class AppSolr
|
|||||||
}
|
}
|
||||||
/*elseif ($action == 'search') {
|
/*elseif ($action == 'search') {
|
||||||
// get all the indexes
|
// get all the indexes
|
||||||
|
|
||||||
//$delIndexes = $this->getApplicationDelegationsIndex ($appUID);
|
//$delIndexes = $this->getApplicationDelegationsIndex ($appUID);
|
||||||
$indexes = $this->aaSearchRecords ($aaappsDBData, array (
|
$indexes = $this->aaSearchRecords ($aaappsDBData, array (
|
||||||
'APP_UID' => $appUID
|
'APP_UID' => $appUID
|
||||||
@@ -648,6 +645,7 @@ class AppSolr
|
|||||||
//var_dump($delIndexes);
|
//var_dump($delIndexes);
|
||||||
|
|
||||||
|
|
||||||
|
$row = '';
|
||||||
foreach ($delIndexes as $delIndex) {
|
foreach ($delIndexes as $delIndex) {
|
||||||
$aRow = array ();
|
$aRow = array ();
|
||||||
|
|
||||||
@@ -1384,7 +1382,6 @@ class AppSolr
|
|||||||
'workspace' => $this->_solrInstance,
|
'workspace' => $this->_solrInstance,
|
||||||
'document' => $xmlDoc
|
'document' => $xmlDoc
|
||||||
);
|
);
|
||||||
|
|
||||||
$oSolrUpdateDocument = Entity_SolrUpdateDocument::createForRequest ($data);
|
$oSolrUpdateDocument = Entity_SolrUpdateDocument::createForRequest ($data);
|
||||||
|
|
||||||
G::LoadClass ('searchIndex');
|
G::LoadClass ('searchIndex');
|
||||||
@@ -1392,7 +1389,6 @@ class AppSolr
|
|||||||
$oSearchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
$oSearchIndex = new BpmnEngine_Services_SearchIndex ($this->_solrIsEnabled, $this->_solrHost);
|
||||||
|
|
||||||
$oSearchIndex->updateIndexDocument ($oSolrUpdateDocument);
|
$oSearchIndex->updateIndexDocument ($oSolrUpdateDocument);
|
||||||
|
|
||||||
|
|
||||||
if($this->debug)
|
if($this->debug)
|
||||||
{
|
{
|
||||||
@@ -1401,11 +1397,11 @@ class AppSolr
|
|||||||
// commit changes no required because of the commitwithin option
|
// commit changes no required because of the commitwithin option
|
||||||
//$oSearchIndex->commitIndexChanges ($this->_solrInstance);
|
//$oSearchIndex->commitIndexChanges ($this->_solrInstance);
|
||||||
//change status in db to indexed
|
//change status in db to indexed
|
||||||
if ($saveDBRecord) {
|
if ($saveDBRecord) {
|
||||||
foreach ($aaAPPUIDs as $aAPPUID) {
|
foreach ($aaAPPUIDs as $aAPPUID) {
|
||||||
$this->applicationChangedUpdateSolrQueue ($aAPPUID ['APP_UID'], 0);
|
$this->applicationChangedUpdateSolrQueue ($aAPPUID ['APP_UID'], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(Exception $ex) {
|
catch(Exception $ex) {
|
||||||
@@ -2094,17 +2090,59 @@ class AppSolr
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ($typeSufix != '*') {
|
if ($typeSufix != '*') {
|
||||||
|
$value = trim($value);
|
||||||
|
$pairs = array(
|
||||||
|
"\x03" => "",
|
||||||
|
"\x04" => "",
|
||||||
|
"\x05" => "",
|
||||||
|
"\x06" => "",
|
||||||
|
"\x07" => "",
|
||||||
|
"\x08" => "",
|
||||||
|
"\x0E" => "",
|
||||||
|
"\x16" => "",
|
||||||
|
"\x00-" => "",
|
||||||
|
"\x09" => "",
|
||||||
|
"\x11" => "",
|
||||||
|
"\x12" => "",
|
||||||
|
"\x14-" => "",
|
||||||
|
"\x1f" => "",
|
||||||
|
"\x7f" => "",
|
||||||
|
);
|
||||||
|
$value = strtr($value, $pairs);
|
||||||
$writer->startElement ("field");
|
$writer->startElement ("field");
|
||||||
$writer->writeAttribute ('name', trim ($k) . $typeSufix);
|
$writer->writeAttribute ('name', trim ($k) . $typeSufix);
|
||||||
|
$writer->startCData ();
|
||||||
$writer->text ($value);
|
$writer->text ($value);
|
||||||
|
$writer->endCData();
|
||||||
$writer->endElement ();
|
$writer->endElement ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$writer->startElement ("field");
|
$value = trim($value);
|
||||||
$writer->writeAttribute ('name', trim ($k) . '_t');
|
$pairs = array(
|
||||||
$writer->text ($value);
|
"\x03" => "",
|
||||||
$writer->endElement ();
|
"\x04" => "",
|
||||||
|
"\x05" => "",
|
||||||
|
"\x06" => "",
|
||||||
|
"\x07" => "",
|
||||||
|
"\x08" => "",
|
||||||
|
"\x0E" => "",
|
||||||
|
"\x16" => "",
|
||||||
|
"\x00-" => "",
|
||||||
|
"\x09" => "",
|
||||||
|
"\x11" => "",
|
||||||
|
"\x12" => "",
|
||||||
|
"\x14-" => "",
|
||||||
|
"\x1f" => "",
|
||||||
|
"\x7f" => "",
|
||||||
|
);
|
||||||
|
$value = strtr($value, $pairs);
|
||||||
|
$writer->startElement ("field");
|
||||||
|
$writer->writeAttribute ('name', trim ($k) . '_t');
|
||||||
|
$writer->startCData ();
|
||||||
|
$writer->text ($value);
|
||||||
|
$writer->endCData();
|
||||||
|
$writer->endElement ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // foreach unserialized data
|
} // foreach unserialized data
|
||||||
|
|||||||
Reference in New Issue
Block a user