Files
luos/workflow/engine/classes/class.solr.php

621 lines
22 KiB
PHP
Raw Normal View History

BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
<?php
/**
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2012 Colosa Inc.23
*
* This program 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.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 5304 Ventura Drive,
* Delray Beach, FL, 33484, USA, or email info@colosa.com.
*
*/
/**
* Interface to the Solr Search server
* @author Herbert Saal Gutierrez
*
*/
class BpmnEngine_SearchIndexAccess_Solr
{
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
const SOLR_VERSION = '&version=2.2';
private $_solrIsEnabled = false;
private $_solrHost = "";
public function __construct($solrIsEnabled = false, $solrHost = "")
{
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// use the parameters to initialize class
$this->_solrIsEnabled = $solrIsEnabled;
$this->_solrHost = $solrHost;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Verify if the Solr service is available
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return bool
*/
public function isEnabled()
{
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// verify solr server response
return $this->_solrIsEnabled;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Returns the total number of indexed documents
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @param
* workspace: workspace name
* @return total
*/
public function getNumberDocuments($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
// get configuration information in base to workspace parameter
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// get total number of documents in registry
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/select/?q=*:*";
$solrIntruct .= self::SOLR_VERSION;
$solrIntruct .= "&start=0&rows=0&echoParams=none&wt=json";
$handlerTotal = curl_init ($solrIntruct);
curl_setopt ($handlerTotal, CURLOPT_RETURNTRANSFER, true);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handlerTotal, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handlerTotal, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handlerTotal, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handlerTotal, CURLOPT_HTTPHEADER, array('Expect:'));
}
$responseTotal = curl_exec ($handlerTotal);
curl_close ($handlerTotal);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// verify the result of solr
$responseSolrTotal = G::json_decode ($responseTotal);
if ($responseSolrTotal->responseHeader->status != 0) {
throw new Exception ("Error returning the total number of documents in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
$numTotalDocs = $responseSolrTotal->response->numFound;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return $numTotalDocs;
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Execute a query in base to Requested data
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function executeQuery($solrRequestData)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
$solrIntruct = '';
// get configuration information in base to workspace parameter
$workspace = $solrRequestData->workspace;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// format request
$query = empty ($solrRequestData->searchText) ? '*:*' : $solrRequestData->searchText;
$query = rawurlencode ($query);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$start = '&start=' . $solrRequestData->startAfter;
$rows = '&rows=' . $solrRequestData->pageSize;
$fieldList = '';
$cols = $solrRequestData->includeCols;
if (! empty ($cols)) {
$fieldList = "&fl=" . implode (",", $cols);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
$sort = '';
if ($solrRequestData->numSortingCols > 0) {
$sort = '&sort=';
for ($i = 0; $i < $solrRequestData->numSortingCols; $i ++) {
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$sort .= $solrRequestData->sortCols [$i] . "%20" . $solrRequestData->sortDir [$i] . ",";
}
$sort = substr_replace ($sort, "", - 1);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
$resultFormat = empty ($solrRequestData->resultFormat) ? '' : '&wt=' . $solrRequestData->resultFormat;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$filters = '';
$aFilters = explode (',', $solrRequestData->filterText);
foreach ($aFilters as $value) {
$filters .= '&fq=' . urlencode ($value);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/select/?q=$query";
$solrIntruct .= "&echoParams=none";
$solrIntruct .= self::SOLR_VERSION;
$solrIntruct .= $start;
$solrIntruct .= $rows;
$solrIntruct .= $fieldList;
$solrIntruct .= $sort;
$solrIntruct .= $filters;
$solrIntruct .= $resultFormat;
// send query
// search the cases in base to datatable parameters
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// decode
$responseSolr = G::json_decode ($response);
if ($responseSolr->responseHeader->status != 0) {
throw new Exception ("Error executing query to Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return $responseSolr;
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Insert or Update document index
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function updateDocument($solrUpdateDocument)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $solrUpdateDocument->workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, $solrUpdateDocument->document); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error updating document in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Commit the changes since the last commit
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function commitChanges($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<commit/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error commiting changes in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Rollback the changes since the last commit
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function rollbackChanges($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<rollback/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error rolling back changes in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Optimize Solr index
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function optimizeChanges($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<optimize/>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error optimizing changes in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
/**
* Return the list of the stored fields in Solr
*
* @param string $workspace
* Solr instance name
* @throws Exception
* @return void mixed of field names
*/
public function getListIndexedStoredFields($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/admin/luke?numTerms=0&wt=json";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// decode
$responseSolr = G::json_decode ($response);
if ($responseSolr->responseHeader->status != 0) {
throw new Exception ("Error getting index fields in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
return $responseSolr;
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Delete all documents from index
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function deleteAllDocuments($workspace)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
// $registry = Zend_Registry::getInstance();
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<delete><query>*:*</query></delete>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error deleting all documents in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Delete specified documents from index
* @gearman = false
* @rest = false
* @background = false
*
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response
*/
public function deleteDocument($workspace, $idQuery)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
// $registry = Zend_Registry::getInstance();
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/update";
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($handler, CURLOPT_HTTPHEADER, array (
'Content-type:application/xml'
)); // -H
curl_setopt ($handler, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt ($handler, CURLOPT_POSTFIELDS, "<delete><query>" . $idQuery . "</query></delete>"); // data
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
$swOk = strpos ($response, '<int name="status">0</int>');
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
if (! $swOk) {
throw new Exception ("Error deleting document in Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
/**
* Execute a query in base to Request data
*
* @param Entity_FacetRequest $facetRequestEntity
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
* @return solr response: list of facets array
*/
public function getFacetsList($facetRequest)
{
if (! $this->_solrIsEnabled)
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct = '';
// get configuration information in base to workspace parameter
$workspace = $facetRequest->workspace;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// format request
$query = empty ($facetRequest->searchText) ? '*:*' : $facetRequest->searchText;
$query = rawurlencode ($query);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$start = '&start=0';
$rows = '&rows=0';
$facets = '&facet=on&facet.mincount=1&facet.limit=20'; // enable facet and
// only return facets
// with minimun one
// instance
foreach ($facetRequest->facetFields as $value) {
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$facets .= '&facet.field=' . $value;
}
foreach ($facetRequest->facetQueries as $value) {
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$facets .= '&facet.query=' . $value;
}
if (! empty ($facetRequest->facetDates)) {
foreach ($facetRequest->facetDates as $value) {
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$facets .= '&facet.date=' . $value;
}
$facets .= '&facet.date.start=' . $facetRequest->facetDatesStart;
$facets .= '&facet.date.end=' . $facetRequest->facetDatesEnd;
$facets .= '&facet.date.gap=' . $facetRequest->facetDateGap;
}
$filters = '';
foreach ($facetRequest->filters as $value) {
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$filters .= '&fq=' . $value;
}
// echo "<pre>";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$resultFormat = '&wt=json';
$solrIntruct = (substr ($this->_solrHost, - 1) == "/") ? $this->_solrHost : $this->_solrHost . "/";
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
$solrIntruct .= $workspace;
$solrIntruct .= "/select/?q=$query";
$solrIntruct .= "&echoParams=none";
$solrIntruct .= self::SOLR_VERSION;
$solrIntruct .= $start;
$solrIntruct .= $rows;
$solrIntruct .= $facets;
$solrIntruct .= $filters;
$solrIntruct .= $resultFormat;
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// send query
// search the cases in base to datatable parameters
$handler = curl_init ($solrIntruct);
curl_setopt ($handler, CURLOPT_RETURNTRANSFER, true);
//Apply proxy settings
$sysConf = System::getSystemConfiguration();
if ($sysConf['proxy_host'] != '') {
curl_setopt($handler, CURLOPT_PROXY, $sysConf['proxy_host'] . ($sysConf['proxy_port'] != '' ? ':' . $sysConf['proxy_port'] : ''));
if ($sysConf['proxy_port'] != '') {
curl_setopt($handler, CURLOPT_PROXYPORT, $sysConf['proxy_port']);
}
if ($sysConf['proxy_user'] != '') {
curl_setopt($handler, CURLOPT_PROXYUSERPWD, $sysConf['proxy_user'] . ($sysConf['proxy_pass'] != '' ? ':' . $sysConf['proxy_pass'] : ''));
}
curl_setopt($handler, CURLOPT_HTTPHEADER, array('Expect:'));
}
$response = curl_exec ($handler);
curl_close ($handler);
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
// decode
$responseSolr = G::json_decode ($response);
if ($responseSolr->responseHeader->status != 0) {
throw new Exception ("Error getting faceted list from Solr." . $solrIntruct . " response error: " . $response . "\n");
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
}
BUG 0000 herbert> SOLR implementation in PMOS2 Solr support in PMOS2 includes: Functionality: - Implementation of Home views (Inbox, Draft, Participated, Unassigned). The views return fast results. - Include read, unread, all, and process filter in inbox View. - Include process filter in draft view. - Include started by me, completed by me, all, process, and status filter in participated view. - Include process filter in unassigned view. - Improved search functionality (search in user defined variables): Use the following syntax to search in process (user defined) variables. {variable_name}:{search_word} ex1:"causal:20*" where causal is the variable defined by the user. + Use of wildcards in search: Use * as wildcard at the begin or end of word + Multiple conditions in search: Separate multiple conditions by space ex2:"Materiales causal:20*" means that we are searching for the word Materiales and the causal that begin with 20. + Search in dates (interval ): Format=> {variable_date}:[yyyy-mm-dd TO yyyy-mm-dd] Local date not UTC date required ex: FechaRegistro:[2011-04-15 TO 2011-04-30] //registros con fecha entre el 2011-04-15 y el 2011-04-30. + we can use the wildcard *: ex: FechaRegistro:[* TO 2011-04-30] //registros con fecha menor o igual a 2011-04-30. FechaRegistro:[2011-04-15 TO *] //registros con fecha mayor o igual a 2011-04-15. + Search of exact phrases. format: {variable}:"frase a buscar" ex: Cliente:"Jesus Marin" - Application update function. + The function is called every time a change is detected in the application's data including the related delegations. - Use of cache to improve performance Not included: - Order of task, sent by, and due date columns. Pending: - Advanced search view using faceted lists.
2012-05-15 10:56:48 -04:00
return $responseSolr;
}
}