mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-11 19:23:01 +02:00
Delegate OCR and AI description search fields to the Piwigo AI plugin
This commit is contained in:
@@ -153,7 +153,8 @@ 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', 'ai_description', 'ocr', 'author');
|
||||
$fields = array('file', 'name', 'comment', 'author');
|
||||
$fields = trigger_change('get_search_allwords_fields', $fields);
|
||||
|
||||
if (isset($search['fields']['allwords']['fields']) and count($search['fields']['allwords']['fields']) > 0)
|
||||
{
|
||||
|
||||
@@ -788,7 +788,8 @@ function ws_images_filteredSearch_create($params, $service)
|
||||
}
|
||||
$search['fields']['allwords']['mode'] = $params['allwords_mode'];
|
||||
|
||||
$allwords_fields_available = array('name', 'comment', 'ai_description', 'ocr', 'file', 'author', 'tags', 'cat-title', 'cat-desc');
|
||||
$allwords_fields_available = array('name', 'comment', 'file', 'author', 'tags', 'cat-title', 'cat-desc');
|
||||
$allwords_fields_available = trigger_change('get_search_allwords_fields', $allwords_fields_available);
|
||||
if (!isset($params['allwords_fields']))
|
||||
{
|
||||
$params['allwords_fields'] = $allwords_fields_available;
|
||||
|
||||
+2
-1
@@ -80,8 +80,9 @@ if (count($words) > 0 or in_array('allwords', $fields))
|
||||
$search['fields']['allwords'] = array(
|
||||
'words' => $words,
|
||||
'mode' => 'AND',
|
||||
'fields' => array('file', 'name', 'comment', 'ai_description', 'ocr', 'tags', 'author', 'cat-title', 'cat-desc'),
|
||||
'fields' => array('file', 'name', 'comment', 'tags', 'author', 'cat-title', 'cat-desc'),
|
||||
);
|
||||
$search['fields']['allwords']['fields'] = trigger_change('get_search_allwords_fields', $search['fields']['allwords']['fields']);
|
||||
}
|
||||
|
||||
$cat_ids = array();
|
||||
|
||||
@@ -251,14 +251,6 @@ const prefix_icon = 'gallery-icon-';
|
||||
<input type="checkbox" id="comment" name="comment">
|
||||
<label for="comment">{'Photo description'|@translate}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="ai_description" name="ai_description">
|
||||
<label for="ai_description">{'AI description'|@translate}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="ocr" name="ocr">
|
||||
<label for="ocr">{'OCR'|@translate}</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="tags" name="tags">
|
||||
<label for="tags">{'Tags'|@translate}</label>
|
||||
|
||||
@@ -1463,7 +1463,7 @@ enabled_high, registration_date, registration_date_string, registration_date_sin
|
||||
),
|
||||
'allwords_fields' => array(
|
||||
'flags' => WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
|
||||
'info' => 'values among [name, comment, tags, file, author, cat-title, cat-desc, ai_description, ocr]',
|
||||
'info' => 'values among [name, comment, tags, file, author, cat-title, cat-desc]',
|
||||
),
|
||||
'tags' => array(
|
||||
'flags' => WS_PARAM_OPTIONAL|WS_PARAM_FORCE_ARRAY,
|
||||
|
||||
Reference in New Issue
Block a user