From 666df528878409c7fd9d05f3a84b1d2e8e3169c0 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Thu, 7 Dec 2023 13:40:52 +0100 Subject: [PATCH] Search: a few fixes for custom metadata in advanced search (39265) --- .../AdvancedMetaData/LuceneDataSource.xml | 12 +- .../LuceneSubItemDataSource.xml | 182 ++++++++---------- .../ILIAS/Glossary/LuceneObjectDefinition.xml | 4 +- .../MediaPool/LuceneObjectDefinition.xml | 8 +- components/ILIAS/Search/README.md | 11 +- .../ILIAS/Wiki/LuceneObjectDefinition.xml | 4 +- 6 files changed, 97 insertions(+), 124 deletions(-) diff --git a/components/ILIAS/AdvancedMetaData/LuceneDataSource.xml b/components/ILIAS/AdvancedMetaData/LuceneDataSource.xml index cd984b30bbbb..83ba53ea9951 100755 --- a/components/ILIAS/AdvancedMetaData/LuceneDataSource.xml +++ b/components/ILIAS/AdvancedMetaData/LuceneDataSource.xml @@ -9,7 +9,7 @@ - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) @@ -25,13 +25,13 @@ - + - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) JOIN object_data obj ON (obj.obj_id = val.obj_id) @@ -51,13 +51,13 @@ - + - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) JOIN object_data obj ON (obj.obj_id = val.obj_id) @@ -77,7 +77,7 @@ - + diff --git a/components/ILIAS/AdvancedMetaData/LuceneSubItemDataSource.xml b/components/ILIAS/AdvancedMetaData/LuceneSubItemDataSource.xml index 194d7fcdf0f1..149cd730240f 100755 --- a/components/ILIAS/AdvancedMetaData/LuceneSubItemDataSource.xml +++ b/components/ILIAS/AdvancedMetaData/LuceneSubItemDataSource.xml @@ -9,10 +9,9 @@ - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -26,19 +25,18 @@ AND val.sub_id IN (?); - - - - + + + + - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -55,19 +53,18 @@ AND val.sub_id IN (?); - - - - + + + + - SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value + SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, vd.value, vd.idx FROM adv_md_values_enum val JOIN adv_mdf_enum vd ON (val.field_id = vd.field_id AND value_index = idx) - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -84,16 +81,16 @@ AND val.sub_id IN (?); - - - - + + + + @@ -101,7 +98,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_ltext val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -115,9 +111,9 @@ AND val.sub_id IN (?); - - - + + + @@ -126,7 +122,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_ltext val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -143,9 +138,9 @@ AND val.sub_id IN (?); - - - + + + @@ -154,7 +149,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_ltext val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -171,9 +165,9 @@ AND val.sub_id IN (?); - - - + + + @@ -182,7 +176,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_date val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -196,9 +189,9 @@ AND val.sub_id IN (?); - - - + + + @@ -207,7 +200,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_date val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -224,9 +216,9 @@ AND val.sub_id IN (?); - - - + + + @@ -235,7 +227,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_date val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -252,9 +243,9 @@ AND val.sub_id IN (?); - - - + + + @@ -263,7 +254,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_datetime val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -277,9 +267,9 @@ AND val.sub_id IN (?); - - - + + + @@ -288,7 +278,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_datetime val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -305,9 +294,9 @@ AND val.sub_id IN (?); - - - + + + @@ -316,7 +305,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_datetime val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -333,9 +321,9 @@ AND val.sub_id IN (?); - - - + + + @@ -344,7 +332,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_float val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -358,9 +345,9 @@ AND val.sub_id IN (?); - - - + + + @@ -369,7 +356,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_float val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -386,9 +372,9 @@ AND val.sub_id IN (?); - - - + + + @@ -397,7 +383,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_float val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -414,9 +399,9 @@ AND val.sub_id IN (?); - - - + + + @@ -425,7 +410,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_int val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -439,9 +423,9 @@ AND val.sub_id IN (?); - - - + + + @@ -450,7 +434,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_int val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -467,9 +450,9 @@ AND val.sub_id IN (?); - - - + + + @@ -478,7 +461,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_int val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -495,9 +477,9 @@ AND val.sub_id IN (?); - - - + + + @@ -506,7 +488,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value, val.title FROM adv_md_values_extlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -520,9 +501,9 @@ AND val.sub_id IN (?); - - - + + + @@ -533,7 +514,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value, val.title FROM adv_md_values_extlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -550,9 +530,9 @@ AND val.sub_id IN (?); - - - + + + @@ -563,7 +543,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value, val.title FROM adv_md_values_extlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -580,9 +559,9 @@ AND val.sub_id IN (?); - - - + + + @@ -593,7 +572,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_intlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -607,9 +585,9 @@ AND val.sub_id IN (?); - - - + + + @@ -618,7 +596,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_intlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -635,9 +612,9 @@ AND val.sub_id IN (?); - - - + + + @@ -646,7 +623,6 @@ SELECT concat('advancedMetaData_', val.field_id) field_name, val.field_id, val.value FROM adv_md_values_intlink val - JOIN object_data obj ON (obj.obj_id = val.obj_id) JOIN adv_mdf_definition def ON (def.field_id = val.field_id) JOIN adv_md_record rec ON (rec.record_id = def.record_id) JOIN adv_md_record_objs robj ON (robj.record_id = rec.record_id AND robj.sub_type = val.sub_type) @@ -663,9 +639,9 @@ AND val.sub_id IN (?); - - - + + + diff --git a/components/ILIAS/Glossary/LuceneObjectDefinition.xml b/components/ILIAS/Glossary/LuceneObjectDefinition.xml index 4d0dae450259..74beebf83855 100755 --- a/components/ILIAS/Glossary/LuceneObjectDefinition.xml +++ b/components/ILIAS/Glossary/LuceneObjectDefinition.xml @@ -17,7 +17,7 @@ - SELECT 'glo' type,term,glo_id,id,'term' metaSubType,id metaSubId + SELECT 'glo' objType,term,glo_id,id,'term' metaType,id metaObjId,glo_id metaRbacId FROM glossary_term gt WHERE glo_id IN (?) @@ -25,7 +25,7 @@ - + diff --git a/components/ILIAS/MediaPool/LuceneObjectDefinition.xml b/components/ILIAS/MediaPool/LuceneObjectDefinition.xml index 6ba696a7b147..8677139efe93 100755 --- a/components/ILIAS/MediaPool/LuceneObjectDefinition.xml +++ b/components/ILIAS/MediaPool/LuceneObjectDefinition.xml @@ -3,8 +3,6 @@ - - @@ -22,7 +20,7 @@ - SELECT title, obj_id, foreign_id AS metaObjId, mep_id, type AS metaType,0 AS metaRbacId, child FROM mep_tree + SELECT title, obj_id, foreign_id AS metaObjId, mep_id, type AS metaType,0 AS metaRbacId, 'mep' as objType, child FROM mep_tree JOIN mep_item ON child = obj_id WHERE type = 'mob' AND mep_id IN (?) @@ -33,6 +31,7 @@ + SELECT caption, location, text_representation FROM media_item @@ -48,7 +47,7 @@ - SELECT title,content, obj_id AS metaObjId, mep_id, type AS metaType,0 AS metaRbacId, child, parent_type FROM mep_tree + SELECT title,content, obj_id AS metaObjId, mep_id, 'mpg' AS metaType, mep_id AS metaRbacId, child, parent_type FROM mep_tree JOIN mep_item ON child = obj_id JOIN page_object po ON obj_id = po.page_id WHERE type = 'pg' AND parent_type = 'mep' @@ -63,6 +62,7 @@ + \ No newline at end of file diff --git a/components/ILIAS/Search/README.md b/components/ILIAS/Search/README.md index 7c154b446c4b..d5b7abaf58a7 100644 --- a/components/ILIAS/Search/README.md +++ b/components/ILIAS/Search/README.md @@ -2,11 +2,8 @@ ## Media Objects and Content Snippets -Content Snippets and Media Objects are only found when using Lucene +Content Snippets and Media Objects are only found when using Lucene search, and not direct search. They are displayed as sub-objects of -Media Pools. - -When searching by (Custom) Metadata in the Advanced Search, Content -Snippets and Media Objects are never found, regardless of whether -Lucene or Advanced Search is used (but they can be found when -in the 'Content' field of the Advanced Search). +Media Pools. This is also the case in the 'Advanced Search', except +when searching via the 'Content' field: there Content Snippets and +Media Objects are also included in the direct search. diff --git a/components/ILIAS/Wiki/LuceneObjectDefinition.xml b/components/ILIAS/Wiki/LuceneObjectDefinition.xml index 0707f6d941de..425071ceb368 100755 --- a/components/ILIAS/Wiki/LuceneObjectDefinition.xml +++ b/components/ILIAS/Wiki/LuceneObjectDefinition.xml @@ -48,7 +48,7 @@ - SELECT 'wiki' type,id,title,wiki_id,create_user,content,'wpg' metaSubType,id metaSubId + SELECT 'wiki' objType,id,title,wiki_id,wiki_id metaRbacId,create_user,content,'wpg' metaType,id metaObjId FROM il_wiki_page wp JOIN page_object po ON wp.id = po.page_id WHERE wiki_id IN(?) @@ -62,7 +62,7 @@ - +