boosts-and-queryconditon.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. diff --git a/search_api.admin.inc b/search_api.admin.inc
  2. index 5fbc8d8..9a5122e 100644
  3. --- a/search_api.admin.inc
  4. +++ b/search_api.admin.inc
  5. @@ -1480,8 +1480,8 @@ function search_api_admin_index_fields(array $form, array &$form_state, SearchAp
  6. $fulltext_type = array(0 => 'text');
  7. $entity_types = entity_get_info();
  8. $default_types = search_api_default_field_types();
  9. - $boosts = drupal_map_assoc(array('0.1', '0.2', '0.3', '0.5', '0.8', '1.0', '2.0', '3.0', '5.0', '8.0', '13.0', '21.0'));
  10. -
  11. + // $boosts = drupal_map_assoc(array('0.1', '0.2', '0.3', '0.5', '0.8', '1.0', '2.0', '3.0', '5.0', '8.0', '13.0', '21.0', '5000', '10000', '20000', '40000', '80000', '160000', '320000'));
  12. + $boosts = drupal_map_assoc(array('0.1', '0.2', '0.3', '0.5', '0.8', '1.0', '2.0', '3.0', '5.0', '8.0', '13.0', '21.0', '100', '1000', '1010', '1020', '1030', '1040', '1050', '1060'));
  13. $form_state['index'] = $index;
  14. $form['#theme'] = 'search_api_admin_fields_table';
  15. $form['#tree'] = TRUE;
  16. diff --git a/search_api.module b/search_api.module
  17. index bba0681..ba27465 100644
  18. --- a/search_api.module
  19. +++ b/search_api.module
  20. @@ -1444,7 +1444,7 @@ function _search_api_query_add_node_access($account, SearchApiQueryInterface $qu
  21. $query->filter($filter);
  22. }
  23. else {
  24. - $query->condition('status', NODE_PUBLISHED);
  25. + // $query->condition('status', NODE_PUBLISHED);
  26. }
  27. // Filter by node access grants.
  28. $filter = $query->createFilter('OR');
  29. @@ -1636,6 +1636,10 @@ function search_api_extract_fields(EntityMetadataWrapper $wrapper, array $fields
  30. foreach ($nested as $prefix => $nested_fields) {
  31. if (isset($wrapper->$prefix)) {
  32. $nested_fields = search_api_extract_fields($wrapper->$prefix, $nested_fields, $value_options);
  33. + # http://drupal.org/node/1873910#comment-6876200
  34. + // $subwrapper = $wrapper->$prefix;
  35. + // $subwrapper->language( $wrapper->language->value() );
  36. + // $nested_fields = search_api_extract_fields($subwrapper, $nested_fields, $value_options);
  37. foreach ($nested_fields as $field => $info) {
  38. $fields["$prefix:$field"] = $info;
  39. }