Skip to content
Snippets Groups Projects
Commit 10df5ed7 authored by Neil Drumm's avatar Neil Drumm :wave:
Browse files

Issue #3393311: Search should only search modules & themes

parent 3a215790
No related branches found
No related tags found
1 merge request!8Issue #3393311: Search should only search modules & themes
Pipeline #32563 passed with warnings
<?php <?php
define('PROJECT_COMPOSER_SEARCH_ROWS', 50);
/** /**
* @param $release_category * @param $release_category
* Either 'legacy' or 'current'. * Either 'legacy' or 'current'.
...@@ -28,7 +30,7 @@ function project_composer_search($release_category) { ...@@ -28,7 +30,7 @@ function project_composer_search($release_category) {
try { try {
$results = apachesolr_search_run('apachesolr', array( $results = apachesolr_search_run('apachesolr', array(
'fq' => array( 'fq' => array(
'bundle:(' . implode(' OR ', project_project_node_types()) . ')', 'bundle:(project_module OR project_theme)',
'sm_field_project_type:full', 'sm_field_project_type:full',
'sm_project_release_categories:' . $release_category, 'sm_project_release_categories:' . $release_category,
), ),
...@@ -41,7 +43,7 @@ function project_composer_search($release_category) { ...@@ -41,7 +43,7 @@ function project_composer_search($release_category) {
'is_uid', 'is_uid',
'ss_field_project_machine_name', 'ss_field_project_machine_name',
), ),
'rows' => 50, 'rows' => PROJECT_COMPOSER_SEARCH_ROWS,
'spellcheck' => 'false', 'spellcheck' => 'false',
// Don't allow local params to pass through to EDismax from the url. We // Don't allow local params to pass through to EDismax from the url. We
// also remove any remaining leading {! since that causes a parse error // also remove any remaining leading {! since that causes a parse error
...@@ -75,7 +77,7 @@ function project_composer_search($release_category) { ...@@ -75,7 +77,7 @@ function project_composer_search($release_category) {
} }
// Next. // Next.
if (15 * $parameters['page'] < $output['total']) { if (PROJECT_COMPOSER_SEARCH_ROWS * $parameters['page'] < $output['total']) {
$output['next'] = url(variable_get('project_composer_packages_url', 'https://packages.drupal.org') . '/' . $core_version_string . '/search.json', array( $output['next'] = url(variable_get('project_composer_packages_url', 'https://packages.drupal.org') . '/' . $core_version_string . '/search.json', array(
'query' => array( 'query' => array(
's' => $parameters['s'], 's' => $parameters['s'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment