From 28b650103a329d808260883fe498bb1bf5fd0880 Mon Sep 17 00:00:00 2001 From: Scott Nath Date: Thu, 20 Sep 2012 13:31:27 -0400 Subject: [PATCH 1/2] bringing repo up to version 2.0.2 --- advanced-search-by-my-solr-server.php | 2 +- readme.txt | 6 +++++- solr.class.inc.php | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/advanced-search-by-my-solr-server.php b/advanced-search-by-my-solr-server.php index 4a7d2f5..f45d389 100755 --- a/advanced-search-by-my-solr-server.php +++ b/advanced-search-by-my-solr-server.php @@ -3,7 +3,7 @@ Plugin Name: Advanced Search by My Solr Server Plugin URI: http://wordpress.org/extend/plugins/advanced-search-by-my-solr-server/ Description: Indexes, removes, and updates documents in the Solr search engine. -Version: 2.0.1 +Version: 2.0.2 Author: www.mysolrserver.com Author URI: http://www.mysolrserver.com */ diff --git a/readme.txt b/readme.txt index ed1634a..09aef8b 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/advanced-search-by-my-solr-serve Tags: solr, search, search results, search integration, custom search, better search, search replacement, category search, comment search, tag search, page search, post search, search highlight, seo Requires at least: 3.0.0 Tested up to: 3.3.1 -Stable tag: 2.0.1 +Stable tag: 2.0.2 A WordPress plugin that replaces the default WordPress search with a lot of benefits @@ -94,6 +94,10 @@ Advanced Search by My Solr Server plugin is tested with "Custom Post Type UI" pl == Changelog == += 2.0.2 = + +* Bug fix while checking Solr connection + = 2.0.1 = * Update installation prerequisites in order to have spell checking work. diff --git a/solr.class.inc.php b/solr.class.inc.php index 9c6062f..7cb82f3 100644 --- a/solr.class.inc.php +++ b/solr.class.inc.php @@ -34,7 +34,9 @@ public function connect($options, $ping = false) { // create the solr service object try { - $this->_solr = new Apache_Solr_Service($this->_solrHost, $this->_solrPort, $this->_solrPath); + require_once("SolrPhpClient/Apache/Solr/HttpTransport/Curl.php"); + $httpTransport = new Apache_Solr_HttpTransport_Curl(); + $this->_solr = new Apache_Solr_Service($this->_solrHost, $this->_solrPort, $this->_solrPath, $httpTransport); } catch ( Exception $e ) { $this->_lastErrorCode = $e->getCode(); $this->_lastErrorMessage = $e->getMessage(); From 3da2b697abd3304a413b0724f89498f443fb77cb Mon Sep 17 00:00:00 2001 From: rebmullin Date: Thu, 20 Sep 2012 12:21:40 -0700 Subject: [PATCH 2/2] 2.0.3 adding proxy and custom field search --- .../Apache/Solr/HttpTransport/Abstract.php | 2 +- .../Apache/Solr/HttpTransport/Curl.php | 26 +++++ .../Apache/Solr/HttpTransport/CurlNoReuse.php | 98 +++++++++++++++++++ .../Solr/HttpTransport/FileGetContents.php | 48 ++++++++- .../Apache/Solr/HttpTransport/Interface.php | 24 ++++- SolrPhpClient/Apache/Solr/Service.php | 60 ++++++++++-- ...-search-by-my-solr-server-options-page.php | 39 +++++++- advanced-search-by-my-solr-server.inc.php | 59 ++++++++++- advanced-search-by-my-solr-server.php | 0 readme.txt | 28 ++++-- solr.class.inc.php | 5 + 11 files changed, 365 insertions(+), 24 deletions(-) mode change 100755 => 100644 advanced-search-by-my-solr-server-options-page.php mode change 100755 => 100644 advanced-search-by-my-solr-server.inc.php mode change 100755 => 100644 advanced-search-by-my-solr-server.php diff --git a/SolrPhpClient/Apache/Solr/HttpTransport/Abstract.php b/SolrPhpClient/Apache/Solr/HttpTransport/Abstract.php index cf9f76d..d16266c 100644 --- a/SolrPhpClient/Apache/Solr/HttpTransport/Abstract.php +++ b/SolrPhpClient/Apache/Solr/HttpTransport/Abstract.php @@ -48,7 +48,7 @@ abstract class Apache_Solr_HttpTransport_Abstract implements Apache_Solr_HttpTra * @var float */ private $_defaultTimeout = false; - + /** * Get the current default timeout setting (initially the default_socket_timeout ini setting) * in seconds diff --git a/SolrPhpClient/Apache/Solr/HttpTransport/Curl.php b/SolrPhpClient/Apache/Solr/HttpTransport/Curl.php index 7cb7743..67b0962 100644 --- a/SolrPhpClient/Apache/Solr/HttpTransport/Curl.php +++ b/SolrPhpClient/Apache/Solr/HttpTransport/Curl.php @@ -90,7 +90,33 @@ function __destruct() // close our curl session curl_close($this->_curl); } + + public function setAuthenticationCredentials($username, $password) + { + // add the options to our curl handle + curl_setopt_array($this->_curl, array( + CURLOPT_USERPWD => $username . ":" . $password, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC + )); + } + public function setProxy($proxy, $port, $username = '', $password = '') + { + // add the options to our curl handle + curl_setopt_array($this->_curl, array( + CURLOPT_PROXY => $proxy, + CURLOPT_PROXYPORT => $port + )); + + if ($username != '' && $password != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + CURLOPT_PROXYUSERPWD => "$username:$password" + )); + } + } + public function performGetRequest($url, $timeout = false) { // check the timeout value diff --git a/SolrPhpClient/Apache/Solr/HttpTransport/CurlNoReuse.php b/SolrPhpClient/Apache/Solr/HttpTransport/CurlNoReuse.php index 1454958..0c1ee5d 100644 --- a/SolrPhpClient/Apache/Solr/HttpTransport/CurlNoReuse.php +++ b/SolrPhpClient/Apache/Solr/HttpTransport/CurlNoReuse.php @@ -55,7 +55,27 @@ class Apache_Solr_HttpTransport_CurlNoReuse extends Apache_Solr_HttpTransport_Ab * SVN ID meta data for this class */ const SVN_ID = '$Id:$'; + + private $_authString = false; + private $_proxy = ''; + private $_proxyPort = ''; + private $_proxyUsername = ''; + private $_proxyPassword = ''; + + public function setAuthenticationCredentials($username, $password) + { + // this is how curl wants it for the CURLOPT_USERPWD + $this->_authString = $username . ":" . $password; + } + public function setProxy($proxy, $port, $username = '', $password = '') + { + $this->_proxy = $proxy; + $this->_proxyPort = $port; + $this->_proxyUsername = $username; + $this->_proxyPassword = $password; + } + public function performGetRequest($url, $timeout = false) { // check the timeout value @@ -84,6 +104,32 @@ public function performGetRequest($url, $timeout = false) // set the timeout CURLOPT_TIMEOUT => $timeout )); + + // set auth if appropriate + if ($this->_authString !== false) + { + curl_setopt_array($curl, array( + CURLOPT_USERPWD => $this->_authString, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC + )); + } + + // set proxy + if ($this->_proxy != '' && $this->_proxyPort != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXY => $this->_proxy, + CURLOPT_PROXYPORT => $this->_proxyPort + )); + + if ($this->_proxyUsername != '' && $this->_proxyPassword != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + CURLOPT_PROXYUSERPWD => "$this->_proxyUsername:$this->_proxyPassword" + )); + } + } // make the request $responseBody = curl_exec($curl); @@ -130,6 +176,32 @@ public function performHeadRequest($url, $timeout = false) CURLOPT_TIMEOUT => $timeout )); + // set auth if appropriate + if ($this->_authString !== false) + { + curl_setopt_array($curl, array( + CURLOPT_USERPWD => $this->_authString, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC + )); + } + + // set proxy + if ($this->_proxy != '' && $this->_proxyPort != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXY => $this->_proxy, + CURLOPT_PROXYPORT => $this->_proxyPort + )); + + if ($this->_proxyUsername != '' && $this->_proxyPassword != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + CURLOPT_PROXYUSERPWD => "$this->_proxyUsername:$this->_proxyPassword" + )); + } + } + // make the request $responseBody = curl_exec($curl); @@ -181,6 +253,32 @@ public function performPostRequest($url, $postData, $contentType, $timeout = fal CURLOPT_TIMEOUT => $timeout )); + // set auth if appropriate + if ($this->_authString !== false) + { + curl_setopt_array($curl, array( + CURLOPT_USERPWD => $this->_authString, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC + )); + } + + // set proxy + if ($this->_proxy != '' && $this->_proxyPort != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXY => $this->_proxy, + CURLOPT_PROXYPORT => $this->_proxyPort + )); + + if ($this->_proxyUsername != '' && $this->_proxyPassword != '') + { + curl_setopt_array($this->_curl, array( + CURLOPT_PROXYAUTH => CURLAUTH_BASIC, + CURLOPT_PROXYUSERPWD => "$this->_proxyUsername:$this->_proxyPassword" + )); + } + } + // make the request $responseBody = curl_exec($curl); diff --git a/SolrPhpClient/Apache/Solr/HttpTransport/FileGetContents.php b/SolrPhpClient/Apache/Solr/HttpTransport/FileGetContents.php index 5e01775..f3386f6 100644 --- a/SolrPhpClient/Apache/Solr/HttpTransport/FileGetContents.php +++ b/SolrPhpClient/Apache/Solr/HttpTransport/FileGetContents.php @@ -61,6 +61,15 @@ class Apache_Solr_HttpTransport_FileGetContents extends Apache_Solr_HttpTranspor */ private $_getContext, $_headContext, $_postContext; + /** + * For POST operations, we're already using the Header context value for + * specifying the content type too, so we have to keep our computed + * authorization header around + * + * @var string + */ + private $_authHeader = ""; + /** * Initializes our reuseable get and post stream contexts */ @@ -70,7 +79,40 @@ public function __construct() $this->_headContext = stream_context_create(); $this->_postContext = stream_context_create(); } + + public function setAuthenticationCredentials($username, $password) + { + // compute the Authorization header + $this->_authHeader = "Authorization: Basic " . base64_encode($username . ":" . $password); + + // set it now for get and head contexts + stream_context_set_option($this->_getContext, 'http', 'header', $this->_authHeader); + stream_context_set_option($this->_headContext, 'http', 'header', $this->_authHeader); + + // for post, it'll be set each time, so add an \r\n so it can be concatenated + // with the Content-Type + $this->_authHeader .= "\r\n"; + } + public function setProxy($proxy, $port, $username = '', $password = '') + { + $proxy = "tcp://$proxy:$port"; + + // set it now for get and head contexts + stream_context_set_option($this->_getContext, 'http', 'proxy', $proxy); + stream_context_set_option($this->_headContext, 'http', 'proxy', $proxy); + + if ($username != '' && $password != '') + { + $authProxy = base64_encode("$username:$password"); + $proxyAutorization = "Proxy-Authorization: Basic $authProxy"; + + // set it now for get and head contexts + stream_context_set_option($this->_getContext, 'http', 'header', $proxyAutorization); + stream_context_set_option($this->_headContext, 'http', 'header', $proxyAutorization); + } + } + public function performGetRequest($url, $timeout = false) { // set the timeout if specified @@ -87,7 +129,7 @@ public function performGetRequest($url, $timeout = false) // use the default timeout pulled from default_socket_timeout otherwise stream_context_set_option($this->_getContext, 'http', 'timeout', $this->getDefaultTimeout()); } - + // $http_response_headers will be updated by the call to file_get_contents later // see http://us.php.net/manual/en/wrappers.http.php for documentation // Unfortunately, it will still create a notice in analyzers if we don't set it here @@ -136,8 +178,8 @@ public function performPostRequest($url, $rawPost, $contentType, $timeout = fals // set HTTP method 'method' => 'POST', - // Add our posted content type - 'header' => "Content-Type: $contentType", + // Add our posted content type (and auth header - see setAuthentication) + 'header' => "{$this->_authHeader}Content-Type: {$contentType}", // the posted content 'content' => $rawPost, diff --git a/SolrPhpClient/Apache/Solr/HttpTransport/Interface.php b/SolrPhpClient/Apache/Solr/HttpTransport/Interface.php index 090fc27..5586d7c 100644 --- a/SolrPhpClient/Apache/Solr/HttpTransport/Interface.php +++ b/SolrPhpClient/Apache/Solr/HttpTransport/Interface.php @@ -59,7 +59,29 @@ public function getDefaultTimeout(); * @param float $timeout */ public function setDefaultTimeout($timeout); - + + /** + * Set authentication credentials to pass along with the requests. + * + * These will be used to perform HTTP Basic authentication. + * + * @param string $username + * @param string $password + */ + public function setAuthenticationCredentials($username, $password); + + /** + * Set proxy. + * + * These will be used to perform HTTP connection througt proxy. + * + * @param string $proxy + * @param string $port + * @param string $username + * @param string $password + */ + public function setProxy($proxy, $port, $username = '', $password = ''); + /** * Perform a GET HTTP operation with an optional timeout and return the response * contents, use getLastResponseHeaders to retrieve HTTP headers diff --git a/SolrPhpClient/Apache/Solr/Service.php b/SolrPhpClient/Apache/Solr/Service.php index ea9ae37..5ce06a1 100644 --- a/SolrPhpClient/Apache/Solr/Service.php +++ b/SolrPhpClient/Apache/Solr/Service.php @@ -1,6 +1,6 @@ _extractUrl = $this->_constructUrl(self::EXTRACT_SERVLET); $this->_pingUrl = $this->_constructUrl(self::PING_SERVLET); $this->_searchUrl = $this->_constructUrl(self::SEARCH_SERVLET); + $this->_systemUrl = $this->_constructUrl(self::SYSTEM_SERVLET, array('wt' => self::SOLR_WRITER)); $this->_threadsUrl = $this->_constructUrl(self::THREADS_SERVLET, array('wt' => self::SOLR_WRITER )); $this->_updateUrl = $this->_constructUrl(self::UPDATE_SERVLET, array('wt' => self::SOLR_WRITER )); @@ -458,7 +460,14 @@ public function setPath($path) { $path = trim($path, '/'); - $this->_path = '/' . $path . '/'; + if (strlen($path) > 0) + { + $this->_path = '/' . $path . '/'; + } + else + { + $this->_path = '/'; + } if ($this->_urlsInited) { @@ -559,7 +568,30 @@ public function setDefaultTimeout($timeout) { $this->getHttpTransport()->setDefaultTimeout($timeout); } + + /** + * Convenience method to set authentication credentials on the current HTTP transport implementation + * + * @param string $username + * @param string $password + */ + public function setAuthenticationCredentials($username, $password) + { + $this->getHttpTransport()->setAuthenticationCredentials($username, $password); + } + /** + * Convenience method to set proxy + * + * @param string $username + * @param string $password + */ + public function setProxy($proxy, $port, $username = '', $password = '') + { + $this->getHttpTransport()->setProxy($proxy, $port, $username, $password); + } + + /** * Set how NamedLists should be formatted in the response data. This mainly effects * the facet counts format. @@ -641,6 +673,18 @@ public function ping($timeout = 2) return false; } } + + /** + * Call the /admin/system servlet and retrieve system information about Solr + * + * @return Apache_Solr_Response + * + * @throws Apache_Solr_HttpTransportException If an error occurs during the service call + */ + public function system() + { + return $this->_sendRawGet($this->_systemUrl); + } /** * Call the /admin/threads servlet and retrieve information about all threads in the @@ -751,8 +795,8 @@ protected function _documentToXmlFragment(Apache_Solr_Document $document) foreach ($document as $key => $value) { - $key = htmlspecialchars($key, ENT_QUOTES, 'UTF-8'); $fieldBoost = $document->getFieldBoost($key); + $key = htmlspecialchars($key, ENT_QUOTES, 'UTF-8'); if (is_array($value)) { diff --git a/advanced-search-by-my-solr-server-options-page.php b/advanced-search-by-my-solr-server-options-page.php old mode 100755 new mode 100644 index f1ce9d5..408e3d9 --- a/advanced-search-by-my-solr-server-options-page.php +++ b/advanced-search-by-my-solr-server-options-page.php @@ -85,6 +85,11 @@ function mss_checkConnectOption($optionType, $connectType) { $mss_passwd = decrypt($options['mss_passwd']); $mss_url = $options['mss_url']; +$mss_proxy = $options['mss_solr_proxy']; +$mss_proxyport = $options['mss_solr_proxyport']; +$mss_proxyusername = $options['mss_solr_proxyusername']; +$mss_proxypassword = decrypt($options['mss_solr_proxypassword']); + $account_plan=''; $account_status=''; $account_expire=''; @@ -95,7 +100,7 @@ function mss_checkConnectOption($optionType, $connectType) { $connected = false; if ($mss_id!='' && $mss_passwd!='') { - $account_info_json = getMssAccountInfo($url_mysolrserver, $url_extraparam, $mss_id, $mss_passwd); + $account_info_json = getMssAccountInfo($url_mysolrserver, $url_extraparam, $mss_id, $mss_passwd, $mss_proxy, $mss_proxyport, $mss_proxyusername, $mss_proxypassword); $account_info = json_decode ($account_info_json, true); //print_r($account_info); if ($account_info['status']=='ok') { @@ -111,6 +116,38 @@ function mss_checkConnectOption($optionType, $connectType) { ?>
+

+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +
+ +
 
+

diff --git a/advanced-search-by-my-solr-server.inc.php b/advanced-search-by-my-solr-server.inc.php old mode 100755 new mode 100644 index b9d9f96..c7f64dc --- a/advanced-search-by-my-solr-server.inc.php +++ b/advanced-search-by-my-solr-server.inc.php @@ -71,10 +71,43 @@ function POSTGET($param){ return ""; } -function getMssAccountInfo($url_mysolrserver, $url_extraparam, $mss_id, $mss_passwd) { +function getMssAccountInfo($url_mysolrserver, $url_extraparam, $mss_id, $mss_passwd, $proxy, $proxyport, $proxyusername, $proxypassword) { $url = $url_mysolrserver . '?action=accountgetinfo&name=' . $mss_id . '&passwd=' . $mss_passwd . '&type=wp' . $url_extraparam; log_message("getMssAccountInfo - url = " . $url_mysolrserver); - $json = file_get_contents($url); + + if ($proxy!='' && $proxyport!='') { + + if ($proxyusername!='' && $proxypassword!='') { + + // Encodage de l'autentification + $authProxy = base64_encode("$proxyusername:$proxypassword"); + // Création des options de la requête + $opts = array( + 'http' => array ( + 'method'=>'GET', + 'proxy'=>"tcp://$proxy:$proxyport", + 'request_fulluri' => true, + 'header'=>"Proxy-Authorization: Basic $authProxy" + ) + ); + } else { + + // Création des options de la requête + $opts = array( + 'http' => array ( + 'proxy'=>"tcp://$proxy:$proxyport", + 'method'=>'GET', + 'request_fulluri' => true + ) + ); + } + // Création du contexte de transaction + $ctx = stream_context_create($opts); + $json = file_get_contents($url,false,$ctx); + + } else { + $json = file_get_contents($url); + } log_message("getMssAccountInfo - json = " . $json); return $json; } @@ -285,7 +318,7 @@ function mss_post( $options, $documents, $commit = true, $optimize = false) { function mss_query( $qry, $offset, $count, $fq, $sortby, $options) { $response = NULL; $facet_fields = array(); - //$options = mss_get_option(); + $options = mss_get_option(); // uncommented in 2.0.3 $solr = new Mss_Solr(); if ($solr->connect($options, true)) { @@ -306,6 +339,26 @@ function mss_query( $qry, $offset, $count, $fq, $sortby, $options) { $params = array(); $params['defType'] = 'dismax'; $params['qf'] = 'tagssrch^5 title^10 categoriessrch^5 content^3.5 comments^1.5'; // TODO : Add "_srch" custom fields ? + /* + + 2.0.3 change: + added this section to add _str and _srch versions for each custom field that's checked in the plugin options area + */ + $cust_array = array(); + $aCustom = explode(',', $options["mss_custom_fields"]); + if (count($aCustom)>0) { + foreach($aCustom as $aCustom_item){ + $cust_array[] = $aCustom_item . '_str'; + $cust_array[] = $aCustom_item . '_srch'; + } + } + if (count($cust_array)>0) { + foreach($cust_array as $custom_item){ + $params['qf'] .= " $custom_item^3"; + } + } + /* end 2.0.3 change added section */ + var_dump($params['qf']); $params['pf'] = 'title^15 text^10'; $params['facet'] = 'true'; $params['facet.field'] = $facet_fields; diff --git a/advanced-search-by-my-solr-server.php b/advanced-search-by-my-solr-server.php old mode 100755 new mode 100644 diff --git a/readme.txt b/readme.txt index 09aef8b..47cb56e 100755 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/advanced-search-by-my-solr-serve Tags: solr, search, search results, search integration, custom search, better search, search replacement, category search, comment search, tag search, page search, post search, search highlight, seo Requires at least: 3.0.0 Tested up to: 3.3.1 -Stable tag: 2.0.2 +Stable tag: 2.0.3 A WordPress plugin that replaces the default WordPress search with a lot of benefits @@ -32,7 +32,7 @@ Advanced Search by My Solr Server plugin replaces the default WordPress search. * Add special template tags so you can create your own custom result pages to match your theme. * Search term suggestions (AutoComplete) * Provides better search results based on relevancy -* Create custom summarys with the search terms highlighted +* Create custom summaries with the search terms highlighted * Completely integrated into default WordPress theme and search widget. * Configuration options allow you to select pages to ignore @@ -41,8 +41,9 @@ Advanced Search by My Solr Server plugin replaces the default WordPress search. = Prerequisite = -A Solr server installed and configured with the provided schema.xml file. -In order to have spell checking work, in the solrconfig.xml file, check : +A Solr server installed and configured with the provided schema.xml file. This file is configured for English content. Update this file according to your content language. + +In order to have spell checking work, in your solrconfig.xml file, check : 1. the spellchecker component have to be correctly configured : @@ -59,7 +60,7 @@ In order to have spell checking work, in the solrconfig.xml file, check : <str>spellcheck</str> </arr> -If you are using "Solr for Wordpress" plugin, deactivate and uninstall it (in previous version, "Solr for Wordpress" plugin was a pre-requisite). +If you are using "Solr for Wordpress" Wordpress plugin, deactivate and uninstall it (in previous version, "Solr for Wordpress" Wordpress plugin was a pre-requisite). = Installation = @@ -68,6 +69,10 @@ If you are using "Solr for Wordpress" plugin, deactivate and uninstall it (in pr 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Go in Advanced Search by My Solr Server settings page ("Advanced Search by My Solr Server"), configure the plugin and Load your blog content in Solr ("Load Content" button) += Customize the plugin display = + +The plugin uses the template files located in the `template` directory. You can implement your own template files by copying theses files with a new name terminating by "_custom" (for instance, the file mss_search.php is copied as mss_search_custom.php). These new files can be located in the plugin's template directory or in your theme's main directory. + == Frequently Asked Questions == @@ -81,8 +86,10 @@ Advanced Search by My Solr Server plugin works with Solr 1.4.x and 3.x = How to manage Custom Post type, custom taxonomies and custom fields? = -Advanced Search by My Solr Server plugin is tested with "Custom Post Type UI" plugin for Custom Post type and custom taxonomies management and with "Custom Field Template" plugin for custom fields management - +Advanced Search by My Solr Server pluginplugin was tested with: +* "Custom Post Type UI" plugin for Custom Post type and custom taxonomies management +* "Custom Field Template" plugin for custom fields management +* WP-Types plugin for Custom Post type and custom taxonomies management and for custom fields management == Screenshots == @@ -94,6 +101,13 @@ Advanced Search by My Solr Server plugin is tested with "Custom Post Type UI" pl == Changelog == += 2.0.3 = + +* Bug fix jQuery conflict +* Tests with WP-Types plugin +* Custom Fields now searched +* Proxies added + = 2.0.2 = * Bug fix while checking Solr connection diff --git a/solr.class.inc.php b/solr.class.inc.php index 7cb82f3..cedfe09 100644 --- a/solr.class.inc.php +++ b/solr.class.inc.php @@ -37,6 +37,11 @@ public function connect($options, $ping = false) { require_once("SolrPhpClient/Apache/Solr/HttpTransport/Curl.php"); $httpTransport = new Apache_Solr_HttpTransport_Curl(); $this->_solr = new Apache_Solr_Service($this->_solrHost, $this->_solrPort, $this->_solrPath, $httpTransport); + + if ($options['mss_solr_proxy']!='' && $options['mss_solr_proxyport']!='') { + $this->_solr->setProxy($options['mss_solr_proxy'], $options['mss_solr_proxyport'], $options['mss_slor_proxyusername'], decrypt($options['mss_solr_proxypassword'])); + } + } catch ( Exception $e ) { $this->_lastErrorCode = $e->getCode(); $this->_lastErrorMessage = $e->getMessage();