mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-12 11:43:01 +02:00
include AI in search results
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
@@ -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')
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user