include AI in search results

This commit is contained in:
Mathieu
2026-08-10 17:27:06 +02:00
parent cb1a748553
commit 79c889ce74
4 changed files with 20 additions and 3 deletions
+4 -1
View File
@@ -153,7 +153,10 @@ function get_regular_search_results($search, $images_where='')
$has_filters_filled = true;
// 1) we search in regular fields (ie, the ones in the piwigo_images table)
$fields = array('file', 'name', 'comment', 'author');
$fields = trigger_change(
'get_search_allwords_fields',
array('file', 'name', 'comment', 'author')
);
if (isset($search['fields']['allwords']['fields']) and count($search['fields']['allwords']['fields']) > 0)
{
+5 -1
View File
@@ -788,7 +788,11 @@ function ws_images_filteredSearch_create($params, $service)
}
$search['fields']['allwords']['mode'] = $params['allwords_mode'];
$allwords_fields_available = array('name', 'comment', 'file', 'author', 'tags', 'cat-title', 'cat-desc');
$allwords_fields_available = trigger_change(
'get_search_allwords_fields',
array('name', 'comment', 'file', 'author', 'tags', 'cat-title', 'cat-desc')
);
if (!isset($params['allwords_fields']))
{
$params['allwords_fields'] = $allwords_fields_available;
+4 -1
View File
@@ -80,7 +80,10 @@ if (count($words) > 0 or in_array('allwords', $fields))
$search['fields']['allwords'] = array(
'words' => $words,
'mode' => 'AND',
'fields' => array('file', 'name', 'comment', 'tags', 'author', 'cat-title', 'cat-desc'),
'fields' => trigger_change(
'get_search_allwords_fields',
array('file', 'name', 'comment', 'tags', 'author', 'cat-title', 'cat-desc')
),
);
}
+7
View File
@@ -217,6 +217,13 @@ array(
'vars' => array('string', 'path', 'array', 'element_info'),
'files' => array('include\functions_picture.inc.php (get_image_location)'),
),
array(
'name' => 'get_search_allwords_fields',
'type' => 'trigger_change',
'vars' => array('array', 'fields'),
'files' => array('search.php', 'include\functions_search.inc.php (get_regular_search_results)', 'include\ws_functions\pwg.images.php (ws_images_filteredSearch_create)'),
'infos' => 'New in 17.0.',
),
array(
'name' => 'get_popup_help_content',
'type' => 'trigger_change',