Permalink
Browse files

Update to latest apachesolr.

  • Loading branch information...
1 parent 69786e1 commit ded7dbdc07b04ef4c6dc9f490a68537c446afa2d @sdboyer sdboyer committed Oct 30, 2012
Showing with 2,620 additions and 3,410 deletions.
  1. +131 −3 sites/all/modules/contrib/apachesolr/CHANGELOG.txt
  2. +27 −15 sites/all/modules/contrib/apachesolr/Drupal_Apache_Solr_Service.php
  3. +53 −19 sites/all/modules/contrib/apachesolr/README.txt
  4. +31 −8 sites/all/modules/contrib/apachesolr/Solr_Base_Query.php
  5. +154 −41 sites/all/modules/contrib/apachesolr/apachesolr.admin.inc
  6. +77 −12 sites/all/modules/contrib/apachesolr/apachesolr.api.php
  7. +317 −160 sites/all/modules/contrib/apachesolr/apachesolr.index.inc
  8. +4 −3 sites/all/modules/contrib/apachesolr/apachesolr.info
  9. +26 −4 sites/all/modules/contrib/apachesolr/apachesolr.install
  10. +200 −0 sites/all/modules/contrib/apachesolr/apachesolr.interface.inc
  11. +386 −173 sites/all/modules/contrib/apachesolr/apachesolr.module
  12. +3 −3 sites/all/modules/contrib/apachesolr/apachesolr_access/apachesolr_access.info
  13. +4 −8 sites/all/modules/contrib/apachesolr/apachesolr_access/tests/apachesolr_access.test
  14. +61 −40 sites/all/modules/contrib/apachesolr/apachesolr_search.admin.inc
  15. +3 −3 sites/all/modules/contrib/apachesolr/apachesolr_search.info
  16. +24 −0 sites/all/modules/contrib/apachesolr/apachesolr_search.install
  17. +203 −169 sites/all/modules/contrib/apachesolr/apachesolr_search.module
  18. +41 −28 sites/all/modules/contrib/apachesolr/apachesolr_search.pages.inc
  19. +391 −68 sites/all/modules/contrib/apachesolr/drush/apachesolr.drush.inc
  20. +6 −0 sites/all/modules/contrib/apachesolr/plugins/facetapi/query_type_term.inc
  21. +0 −8 sites/all/modules/contrib/apachesolr/solr-conf/protwords.txt
  22. +0 −513 sites/all/modules/contrib/apachesolr/solr-conf/schema-solr3x.xml
  23. +0 −497 sites/all/modules/contrib/apachesolr/solr-conf/schema.xml
  24. +0 −743 sites/all/modules/contrib/apachesolr/solr-conf/solrconfig-solr3x.xml
  25. +0 −736 sites/all/modules/contrib/apachesolr/solr-conf/solrconfig.xml
  26. +202 −5 sites/all/modules/contrib/apachesolr/tests/Dummy_Solr.php
  27. +143 −55 sites/all/modules/contrib/apachesolr/tests/apachesolr_base.test
  28. +4 −3 sites/all/modules/contrib/apachesolr/tests/apachesolr_test/apachesolr_test.info
  29. +7 −1 sites/all/modules/contrib/apachesolr/tests/solr_base_query.test
  30. +121 −92 sites/all/modules/contrib/apachesolr/tests/solr_index_and_search.test
  31. +1 −0 sites/all/modules/contrib/features/includes/features.user.inc
@@ -1,6 +1,134 @@
-Apache Solr integration 7.x-1.x-xxxx, xxxx-xx-xx
-------------------------------
-Issue #1515580 by Nick_vh | yannou: Fixed Deleting node is impossible, stdClass problem.
+Apache Solr integration 7.x-1.x, xxxx-xx-xx
+-----------------------------
+
+Apache Solr integration 7.x-1.1, 2012-10-15
+-----------------------------
+#1780200 by pwolanin: document basic auth in README.
+#1226274 by pwolanin: Fixes for schema.xml version numbering and organization.
+
+Apache Solr integration 7.x-1.0, 2012-10-13
+-----------------------------
+#761990 by pwolanin, jhedstrom, Nick_vh, jpmckinney | morningtime: Fixed 400 Bad Status if URL length limit exceeded.
+#1811364 by Nick_vh: Fixed Add newly created content type to the indexed bundles for all environments.
+#1811456 by rupl: Fixed Improve documentation of addFilter in apachesolr.api.php.
+#1773506 by drzraf: Fixed drush solr-search notice when file entity are part of the result.
+#1688150 by HalfChem, cam8001, jhedstrom, Nick_vh: Fixed Search query string gets double encoded when core Search block form is submitted.
+#1794602 by pwolanin, Nick_vh | ppmr: Fixed Undefined index: path in ApacheSolrDocument->__get() (line 304 of ...\apachesolr\Apache_Solr_Document.
+#1773506 by drzraf: Fixed drush solr-search notice when file entity are part of the result.
+#1764334 by cpliakas: Fixed Negative percentage of documents sent to the server for indexing.
+#1806300 by Nick_vh: Separate out the creation of the document from the index process.
+#1807552 by Nick_vh, wimvds: Fixed Site and url wrong when indexing multilingual content (using i18n module).
+#1759190 by mkalkbrenner: Fixed obsolete form code?.
+#1802288 by Nick_vh: Fixed Improve testing of node deletion.
+
+Apache Solr integration 7.x-1.0-rc5, 2012-10-01
+-----------------------------
+#1698050 by duellj: fix for apachesolr_clean_text() should strip extra spaces.
+#1764450 by cpliakas: Improve the docblocks in apachesolr.index.inc.
+#1800324 by pwolanin: Clean up and align node access tests.
+#1799330 by pwolanin: fix for Stats table missing t() calls.
+#1787370 by pwolanin: Don't complain about schema version if it doesn't match expected naming pattern.
+#1790590 by pwolanin: Fix DrupalSolrOnlineWebTestCase so it works with any multicore setup.
+#1799032 by pwolanin: Remove uneeded object reference in indexing function.
+#1793610 by zengenuity: Fix for regession - spelling suggestions missing.
+
+Apache Solr integration 7.x-1.0-rc4, 2012-09-21
+-----------------------------
+#1790894 by pwolanin: fix for Cloning an environment doesn't clone the bundles to be indexed.
+#1778050 by Nick_vh, pwolanin: fix for stale cache when CTools is already enabled.
+#1778266 by Nick_vh, mkalkbrenner: Refactoring of DrupalSolrOnlineWebTestCase to be used by Others.
+#1778266 by mkalkbrenner: Refactoring of DrupalSolrOnlineWebTestCase to be used by Others.
+#1789526 by pwolanin: Clarify lack of upgrade path from 6.x-1.x.
+#1765938 by cpliakas: Added Move the variable_get() for 'apachesolr_environments()" after the cache_set() so that URLs can be modified dynamically.
+#1782436 by cspitzlay: Fixed Error and obsolete hint in code comment.
+#1732900 by cpliakas: Added Change the wording of the generic 'Apache Solr server unavailable" error message.
+#1781040 by mkalkbrenner: Fixed Switch 'Enable spell check" does not work - spell check is allways on.
+#1786450 by Nick_vh: Fixed apachesolr.interface.inc is not always loaded.
+#1760592 by cpliakas, pwolanin: fix for core_search page does not use the current default search environment.
+#1759004 by mkalkbrenner, pwolanin: fix for apachesolr_search_custom_page_search_form_submit() kills all $_GET parameters.
+#1778150 by cpliakas, pwolanin: fix for SQL error in apachesolr_environment_load_subrecords().
+#1743138 by mundanity: Fixed Invalid argument when running Drush.
+#1751640 by cpliakas: Added drush commands to see the ID of the last item indexes as well as the next item queued for indexing.
+#1708150 by ianmthomasuk, Nick_vh, pwolanin: Added additional typing to function definitions.
+#1759110 by Nick_vh: Fixed process response fails if variable was set but never removed.
+#1741066 by Nick_vh: Added geo query type to make contrib's modules life easier.
+#1730840 by pwolanin: Normalize boolean and other values for parameters like hl.
+#1729836 by pwolanin: fix for "Results per page" option for a search page is broken.
+#1719302 by Nick_vh, msti: Fixed Running an empty facet query so the facet blocks can be displayed.
+#1722966 by greggles: Fixed make apachesolr_index_batch_index_finished() message more translateable.
+#1717628 by Nick_vh, pwolanin: Added 'Save and Edit" functionality for configuration pages - Follow ups.
+
+Apache Solr integration 7.x-1.0-rc3, 2012-08-10
+------------------------------
+#1682004 by Nick_vh: Add template hints for search results based on search page.
+#1722012 by mkalkbrenner, Nick_vh: fix for Missing argument 4 for apachesolr_multilingual_apachesolr_index_documents_alter().
+#1717490 by pwolanin: fix for Search result template suggestions relies on non-required fields.
+#1708212 by ianmthomasuk, Nick_vh: Fixed Duplicate field error when indexing single value fields.
+#1702788 by mkalkbrenner: Fixed content and teaser are empty if node->language is not default.
+#1708166 by ianmthomasuk: Fixed Thow exception if asked for invalid solr environment.
+#1717628 by Nick_vh | cpliakas: Added 'Save and Edit" functionality for configuration pages.
+#1718172 by Nick_vh, pwolanin: Fixed Move search result alter hook earlier, and make sure needed data is set.
+#1702526 by Nick_vh: Fixed apachesolr_search_page_load() is quirky.
+#1717958 by pwolanin: Fix for text_und fields should be exposed for searching in the admin section.
+#1708538 by Nick_vh: Fixed Move the start param above the query alter.
+#1700472 by pwolanin: Make 'apachesolr_search_process_response_callback' a search environment variable.
+#1439564 by recidive, neochief, Nick_vh, dawehner, jhedstrom: Added Index bundles Export/Import.
+#1652746 by martins.bertins | chrisssi: Fixed Notice: Undefined offset: 3 in _menu_translate().
+#1670198 by alanmackenzie | ruedu: Fixed Unable to export/import settings using features module.
+#1681946 by Josh Waihi: Fixed apachesolr_index_nodeapi_mass_delete() doesn't work.
+#1650096 by Nick_vh | cappadona: Fixed addParam() creates duplicate filters when dealing with fq.
+#1677050 by cpliakas: Fix for Cancel link when creating a new environment.
+#1673086 by pwolanin: Add drush commands to get, set, del environment variables.
+#1682004 by cpliakas: Added template hints for search results based on search page.
+#1672738 by Nick_vh: Added Allow a dynamic apachesolr_process_results() function.
+#1473722 by levialliance: Added Bundle specific overrides.
+#1408844 by Nick_vh, jrbeeman: Added As a site builder I want to override the environment settings in settings.php.
+#1652746 by chrisssi: Fixed Notice: Undefined offset: 3 in _menu_translate() (Zeile 775 von /var/www/includes/menu.inc).
+#1402748 by Nick_vh, killua99: Fixed Check in apachesolr_do_query() if the static of the query with that name already exists, and if so return it.
+
+Apache Solr integration 7.x-1.0-rc2, 2012-06-21
+------------------------------
+Renamed schema.xml and solrconfig.xml to rc2
+
+Apache Solr integration 7.x-1.0-rc1, 2012-06-21
+------------------------------
+#1642140 by Nick_vh: Fixed Make the search query also escape the slash and move away from menu_tail() to just 1 argument.
+#1518108 by grendzy: Added Devel interface for inspecting solr documents.
+#1402748 by Nick_vh: Fixed Check in apachesolr_do_query() if the static of the query with that name already exists, and if so return it.
+#1631702 by Nick_vh | khaled.zaidan: Fixed Report at admin/reports/apachesolr doesn't always display data from the current default solr server.
+#1647668 by paulmckibben: Fixed Error messages when indexing - Notice: Undefined property: stdClass::$nid in DatabaseStatementBase->fetchAllAssoc().
+#1475014 by ceng, Nick_vh: Fixed Drush command solr-delete-index ignores type arguments.
+#1588256 by InternetDevels.Com, Nick_vh | RaulMuroc: Fixed Warning: Invalid argument supplied for foreach() in apachesolr_entity_update() (line 1766 of /apachesolr/apachesolr.module).
+#1612530 by Nick_vh, willmoy: Added Results say '0 comments' when comment.module is disabled.
+#1522174 by pwolanin: Fixed hook_node_type_delete() is wrong.
+#1576710 by skwashd: Added Indexing with drush cron generates a lot of invalid cron notifications.
+#1543754 by iamEAP: Fixed Schema inconsistency introduced by apachesolr_update_7013.
+#1481564 by milesw: Added Allow other modules to react when there are no results.
+#1470794 by pwolanin: Added Show size of index on disk in index report.
+#1586320 by cpliakas, pwolanin: Added support for the ExternalFileField field type.
+#1613328 by cpliakas: Fixed The service_class() is not passed to apachesolr_server_status() when checking each server's status on the settings page.
+#1621142 by pwolanin: Fixed Broken logic in indexing of extra data.
+#1627484 by gnucifer: Fixed 'allowed operator" not transfered from field definitions.
+#1627604 by Nick_vh: Fixed Add query type for taxonomy_term_reference().
+#1609184 by pwolanin: Minor code cleanup in MLT response handling .
+#1611338 by remimikalsen: Added Allowing several bundles to share the same field name within a given entity type after field_mapping_alter().
+#1568126 by fearlsgroove, pwolanin: Fixed Apachesolr causes all simpletests to fail.
+#1609030 by pwolanin: Fix for Missing search page still executes search.
+#1572722 by eporama, cpliakas, wonder95: Added integration with the Entity References module.
+#1567614 by pwolanin: fix for Uninstall is not complete.
+#1559880 by pwolanin: fix for 'retain filters' checkbox does not work.
+#1558626 by pwolanin: fix for broken OR facet when value has spaces (committed in 16ef187).
+#1538244 by by julianmancera: Fix for Solr base query adds an extra slash in getPath() when there is no 'q' param.
+#1532214 by setvik, pwolanin: Fox for mergePolicy syntax has changed and throws error in Apache Solr 3.6, update config versions.
+#1536936 by pwolanin: Fix for Use json.nl=map for Luke and other json data.
+#1536628 by Nick_vh: Added exclude hook that allows to skip content without removing it from the table.
+#1536600 by Nick_vh: Fixed Performance optimizations when doing hundreds of deletes.
+#1515822 by pwolanin, Nick_vh: Added Support notion of parent entity for derived documents.
+#1519900 by pwolanin, Nick_vh, Georgique: Fixed Error in apachesolr_index_get_entities_to_index() function.
+
+Apache Solr integration 7.x-1.0-beta19, 2012-04-05
+------------------------------
+#1515580 by Nick_vh | yannou: Fixed Deleting node is impossible, stdClass problem.
Apache Solr integration 7.x-1.0-beta18, 2012-04-04
------------------------------
@@ -62,7 +62,7 @@
* methods for pinging, adding, deleting, committing, optimizing and searching.
*/
-class DrupalApacheSolrService {
+class DrupalApacheSolrService implements DrupalApacheSolrServiceInterface {
/**
* How NamedLists should be formatted in the output. This specifically effects facet counts. Valid values
* are 'map' (default) or 'flat'.
@@ -143,7 +143,7 @@ public function ping($timeout = 2) {
* @return
* (array) With all the system info
*/
- public function setSystemInfo() {
+ protected function setSystemInfo() {
$url = $this->_constructUrl(self::SYSTEM_SERVLET, array('wt' => 'json'));
if ($this->env_id) {
$this->system_info_cid = $this->env_id . ":system:" . drupal_hash_base64($url);
@@ -180,7 +180,12 @@ public function getSystemInfo() {
*/
protected function setLuke($num_terms = 0) {
if (empty($this->luke[$num_terms])) {
- $url = $this->_constructUrl(self::LUKE_SERVLET, array('numTerms' => "$num_terms", 'wt' => 'json'));
+ $params = array(
+ 'numTerms' => "$num_terms",
+ 'wt' => 'json',
+ 'json.nl' => self::NAMED_LIST_FORMAT,
+ );
+ $url = $this->_constructUrl(self::LUKE_SERVLET, $params);
if ($this->env_id) {
$cid = $this->env_id . ":luke:" . drupal_hash_base64($url);
$cache = cache_get($cid, 'cache_apachesolr');
@@ -267,25 +272,28 @@ public function getStatsSummary() {
'@deletes_total' => '',
'@schema_version' => '',
'@core_name' => '',
+ '@index_size' => '',
);
if (!empty($stats)) {
$docs_pending_xpath = $stats->xpath('//stat[@name="docsPending"]');
- $summary['@pending_docs'] = (int) trim($docs_pending_xpath[0]);
+ $summary['@pending_docs'] = (int) trim(current($docs_pending_xpath));
$max_time_xpath = $stats->xpath('//stat[@name="autocommit maxTime"]');
$max_time = (int) trim(current($max_time_xpath));
// Convert to seconds.
$summary['@autocommit_time_seconds'] = $max_time / 1000;
$summary['@autocommit_time'] = format_interval($max_time / 1000);
$deletes_id_xpath = $stats->xpath('//stat[@name="deletesById"]');
- $summary['@deletes_by_id'] = (int) trim($deletes_id_xpath[0]);
+ $summary['@deletes_by_id'] = (int) trim(current($deletes_id_xpath));
$deletes_query_xpath = $stats->xpath('//stat[@name="deletesByQuery"]');
- $summary['@deletes_by_query'] = (int) trim($deletes_query_xpath[0]);
+ $summary['@deletes_by_query'] = (int) trim(current($deletes_query_xpath));
$summary['@deletes_total'] = $summary['@deletes_by_id'] + $summary['@deletes_by_query'];
$schema = $stats->xpath('/solr/schema[1]');
$summary['@schema_version'] = trim($schema[0]);;
$core = $stats->xpath('/solr/core[1]');
$summary['@core_name'] = trim($core[0]);
+ $size_xpath = $stats->xpath('//stat[@name="indexSize"]');
+ $summary['@index_size'] = trim(current($size_xpath));
}
return $summary;
@@ -383,6 +391,7 @@ public function makeServletRequest($servlet, $params = array(), $options = array
// Add default params.
$params += array(
'wt' => 'json',
+ 'json.nl' => self::NAMED_LIST_FORMAT,
);
$url = $this->_constructUrl($servlet, $params);
@@ -416,7 +425,7 @@ protected function _sendRawPost($url, $options = array()) {
*
* This is just a wrapper around drupal_http_request().
*/
- protected function _makeHttpRequest($url, $options = array()) {
+ protected function _makeHttpRequest($url, array $options = array()) {
if (!isset($options['method']) || $options['method'] == 'GET' || $options['method'] == 'HEAD') {
// Make sure we are not sending a request body.
$options['data'] = NULL;
@@ -725,7 +734,7 @@ public function optimize($waitFlush = true, $waitSearcher = true, $timeout = 360
/**
* Like PHP's built in http_build_query(), but uses rawurlencode() and no [] for repeated params.
*/
- public function httpBuildQuery(array $query, $parent = '') {
+ protected function httpBuildQuery(array $query, $parent = '') {
$params = array();
foreach ($query as $key => $value) {
@@ -757,10 +766,7 @@ public function httpBuildQuery(array $query, $parent = '') {
*
* @throws Exception If an error occurs during the service call
*/
- public function search($query = '', $params = array(), $method = 'GET') {
- if (!is_array($params)) {
- $params = array();
- }
+ public function search($query = '', array $params = array(), $method = 'GET') {
// Always use JSON. See http://code.google.com/p/solr-php-client/issues/detail?id=6#c1 for reasoning
$params['wt'] = 'json';
// Additional default params.
@@ -773,9 +779,15 @@ public function search($query = '', $params = array(), $method = 'GET') {
// PHP's built in http_build_query() doesn't give us the format Solr wants.
$queryString = $this->httpBuildQuery($params);
// Check string length of the query string, change method to POST
- // if longer than 4000 characters (typical server handles 4096 max).
- // @todo - make this a per-server setting.
- if (strlen($queryString) > variable_get('apachesolr_search_post_threshold', 4000)) {
+ $len = strlen($queryString);
+ // Fetch our threshold to find out when to flip to POST
+ $max_len = apachesolr_environment_variable_get($this->env_id, 'apachesolr_search_post_threshold', 3600);
+
+ // if longer than $max_len (default 3600) characters
+ // we should switch to POST (a typical server handles 4096 max).
+ // If this class is used independently (without environments), we switch automatically to POST at an
+ // limit of 1800 chars.
+ if (($len > 1800) && (empty($this->env_id) || ($len > $max_len))) {
$method = 'POST';
}
Oops, something went wrong.

0 comments on commit ded7dbd

Please sign in to comment.