//retrieve alias lowercase

executing query 
select A.ld_id, A.ld_customid, A.ld_docref, A.ld_type, A.ld_version, A.ld_lastmodified, A.ld_date, A.ld_publisher, A.ld_creation, A.ld_creator, A.ld_filesize, A.ld_immutable, A.ld_indexed, A.ld_lockuserid, A.ld_filename, A.ld_status, A.ld_signed, A.ld_rating, A.ld_fileversion, A.ld_comment, A.ld_workflowstatus, A.ld_startpublishing, A.ld_stoppublishing, A.ld_published, FOLD.ld_name, A.ld_folderid, A.ld_tgs tags, A.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, A.ld_stamped, A.ld_password, A.ld_workflowstatusdisp, A.ld_language, A.ld_pages, A.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id left outer join ld_template C on A.ld_templateid=C.ld_id , ld_document_ext C1 where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_templateid=102 and A.ld_docref is null and ( ((C1.ld_docid=A.ld_id and (C1.ld_name='Keyword' or C1.ld_name like 'Keyword-%') and lower(C1.ld_stringvalue) like '%memento%'))) UNION select A.ld_id, REF.ld_customid, A.ld_docref, A.ld_type, REF.ld_version, REF.ld_lastmodified, REF.ld_date, REF.ld_publisher, REF.ld_creation, REF.ld_creator, REF.ld_filesize, REF.ld_immutable, REF.ld_indexed, REF.ld_lockuserid, A.ld_filename, REF.ld_status, REF.ld_signed, REF.ld_rating, REF.ld_fileversion, A.ld_comment, REF.ld_workflowstatus, REF.ld_startpublishing, REF.ld_stoppublishing, REF.ld_published, FOLD.ld_name, A.ld_folderid, REF.ld_tgs tags, REF.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, REF.ld_stamped, REF.ld_password, REF.ld_workflowstatusdisp, REF.ld_language, REF.ld_pages, REF.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id join ld_document REF on A.ld_docref=REF.ld_id left outer join ld_template C on REF.ld_templateid=C.ld_id , ld_document_ext C1 where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and REF.ld_templateid=102 and A.ld_docref is not null and REF.ld_deleted=0 and A.ld_docref = REF.ld_id and ( ((C1.ld_docid=REF.ld_id and (C1.ld_name='Keyword' or C1.ld_name like 'Keyword-%') and lower(C1.ld_stringvalue) like '%memento%')))

// just lowercase
executing query 
select A.ld_id, A.ld_customid, A.ld_docref, A.ld_type, A.ld_version, A.ld_lastmodified, A.ld_date, A.ld_publisher, A.ld_creation, A.ld_creator, A.ld_filesize, A.ld_immutable, A.ld_indexed, A.ld_lockuserid, A.ld_filename, A.ld_status, A.ld_signed, A.ld_rating, A.ld_fileversion, A.ld_comment, A.ld_workflowstatus, A.ld_startpublishing, A.ld_stoppublishing, A.ld_published, FOLD.ld_name, A.ld_folderid, A.ld_tgs tags, A.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, A.ld_stamped, A.ld_password, A.ld_workflowstatusdisp, A.ld_language, A.ld_pages, A.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id left outer join ld_template C on A.ld_templateid=C.ld_id , ld_document_ext C1 where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_templateid=102 and A.ld_docref is null and ( ((C1.ld_docid=A.ld_id and (C1.ld_name='Keyword' or C1.ld_name like 'Keyword-%') and lower(C1.ld_stringvalue) like '%memento%')))


// saved query
executing query 
select A.ld_id, A.ld_customid, A.ld_docref, A.ld_type, A.ld_version, A.ld_lastmodified, A.ld_date, A.ld_publisher, A.ld_creation, A.ld_creator, A.ld_filesize, A.ld_immutable, A.ld_indexed, A.ld_lockuserid, A.ld_filename, A.ld_status, A.ld_signed, A.ld_rating, A.ld_fileversion, A.ld_comment, A.ld_workflowstatus, A.ld_startpublishing, A.ld_stoppublishing, A.ld_published, FOLD.ld_name, A.ld_folderid, A.ld_tgs tags, A.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, A.ld_stamped, A.ld_password, A.ld_workflowstatusdisp, A.ld_language, A.ld_pages, A.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id left outer join ld_template C on A.ld_templateid=C.ld_id , ld_document_ext C1 where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_templateid=102 and A.ld_docref is null and ( ((C1.ld_docid=A.ld_id and (C1.ld_name='Keyword' or C1.ld_name like 'Keyword-%') and C1.ld_stringvalue like '%memento%')))


// formattate:
SELECT A.ld_id,
       A.ld_customid,
       A.ld_docref,
       A.ld_type,
       A.ld_version,
       A.ld_lastmodified,
       A.ld_date,
       A.ld_publisher,
       A.ld_creation,
       A.ld_creator,
       A.ld_filesize,
       A.ld_immutable,
       A.ld_indexed,
       A.ld_lockuserid,
       A.ld_filename,
       A.ld_status,
       A.ld_signed,
       A.ld_rating,
       A.ld_fileversion,
       A.ld_comment,
       A.ld_workflowstatus,
       A.ld_startpublishing,
       A.ld_stoppublishing,
       A.ld_published,
       FOLD.ld_name,
       A.ld_folderid,
       A.ld_tgs tags,
       A.ld_templateid,
       C.ld_name,
       A.ld_tenantid,
       A.ld_docreftype,
       A.ld_stamped,
       A.ld_password,
       A.ld_workflowstatusdisp,
       A.ld_language,
       A.ld_pages,
       A.ld_color
FROM   ld_document A
       JOIN ld_folder FOLD
         ON A.ld_folderid = FOLD.ld_id
       LEFT OUTER JOIN ld_template C
                    ON A.ld_templateid = C.ld_id,
       ld_document_ext C1
WHERE  A.ld_deleted = 0
       AND A.ld_nature = 0
       AND NOT A.ld_status = 3
       AND A.ld_folderid = FOLD.ld_id
       AND A.ld_tenantid = 1
       AND A.ld_templateid = 102
       AND A.ld_docref IS NULL
       AND ((( C1.ld_docid = A.ld_id
               AND ( C1.ld_name = 'Keyword'
                      OR C1.ld_name LIKE 'Keyword-%' )
               AND Lower(C1.ld_stringvalue) LIKE '%memento%' )))
UNION
SELECT A.ld_id,
       REF.ld_customid,
       A.ld_docref,
       A.ld_type,
       REF.ld_version,
       REF.ld_lastmodified,
       REF.ld_date,
       REF.ld_publisher,
       REF.ld_creation,
       REF.ld_creator,
       REF.ld_filesize,
       REF.ld_immutable,
       REF.ld_indexed,
       REF.ld_lockuserid,
       A.ld_filename,
       REF.ld_status,
       REF.ld_signed,
       REF.ld_rating,
       REF.ld_fileversion,
       A.ld_comment,
       REF.ld_workflowstatus,
       REF.ld_startpublishing,
       REF.ld_stoppublishing,
       REF.ld_published,
       FOLD.ld_name,
       A.ld_folderid,
       REF.ld_tgs tags,
       REF.ld_templateid,
       C.ld_name,
       A.ld_tenantid,
       A.ld_docreftype,
       REF.ld_stamped,
       REF.ld_password,
       REF.ld_workflowstatusdisp,
       REF.ld_language,
       REF.ld_pages,
       REF.ld_color
FROM   ld_document A
       JOIN ld_folder FOLD
         ON A.ld_folderid = FOLD.ld_id
       JOIN ld_document REF
         ON A.ld_docref = REF.ld_id
       LEFT OUTER JOIN ld_template C
                    ON REF.ld_templateid = C.ld_id,
       ld_document_ext C1
WHERE  A.ld_deleted = 0
       AND A.ld_nature = 0
       AND NOT A.ld_status = 3
       AND A.ld_folderid = FOLD.ld_id
       AND A.ld_tenantid = 1
       AND REF.ld_templateid = 102
       AND A.ld_docref IS NOT NULL
       AND REF.ld_deleted = 0
       AND A.ld_docref = REF.ld_id
       AND ((( C1.ld_docid = REF.ld_id
               AND ( C1.ld_name = 'Keyword'
                      OR C1.ld_name LIKE 'Keyword-%' )
               AND Lower(C1.ld_stringvalue) LIKE '%memento%' )))
			   
			   
----
2)
executing query
SELECT A.ld_id,
       A.ld_customid,
       A.ld_docref,
       A.ld_type,
       A.ld_version,
       A.ld_lastmodified,
       A.ld_date,
       A.ld_publisher,
       A.ld_creation,
       A.ld_creator,
       A.ld_filesize,
       A.ld_immutable,
       A.ld_indexed,
       A.ld_lockuserid,
       A.ld_filename,
       A.ld_status,
       A.ld_signed,
       A.ld_rating,
       A.ld_fileversion,
       A.ld_comment,
       A.ld_workflowstatus,
       A.ld_startpublishing,
       A.ld_stoppublishing,
       A.ld_published,
       FOLD.ld_name,
       A.ld_folderid,
       A.ld_tgs tags,
       A.ld_templateid,
       C.ld_name,
       A.ld_tenantid,
       A.ld_docreftype,
       A.ld_stamped,
       A.ld_password,
       A.ld_workflowstatusdisp,
       A.ld_language,
       A.ld_pages,
       A.ld_color
FROM   ld_document A
       JOIN ld_folder FOLD
         ON A.ld_folderid = FOLD.ld_id
       LEFT OUTER JOIN ld_template C
                    ON A.ld_templateid = C.ld_id,
       ld_document_ext C1
WHERE  A.ld_deleted = 0
       AND A.ld_nature = 0
       AND NOT A.ld_status = 3
       AND A.ld_folderid = FOLD.ld_id
       AND A.ld_tenantid = 1
       AND A.ld_templateid = 102
       AND A.ld_docref IS NULL
       AND ((( C1.ld_docid = A.ld_id
               AND ( C1.ld_name = 'Keyword'
                      OR C1.ld_name LIKE 'Keyword-%' )
               AND Lower(C1.ld_stringvalue) LIKE '%memento%' ))) 


----------------------------------------------
												
3)
SELECT A.ld_id,
       A.ld_customid,
       A.ld_docref,
       A.ld_type,
       A.ld_version,
       A.ld_lastmodified,
       A.ld_date,
       A.ld_publisher,
       A.ld_creation,
       A.ld_creator,
       A.ld_filesize,
       A.ld_immutable,
       A.ld_indexed,
       A.ld_lockuserid,
       A.ld_filename,
       A.ld_status,
       A.ld_signed,
       A.ld_rating,
       A.ld_fileversion,
       A.ld_comment,
       A.ld_workflowstatus,
       A.ld_startpublishing,
       A.ld_stoppublishing,
       A.ld_published,
       FOLD.ld_name,
       A.ld_folderid,
       A.ld_tgs tags,
       A.ld_templateid,
       C.ld_name,
       A.ld_tenantid,
       A.ld_docreftype,
       A.ld_stamped,
       A.ld_password,
       A.ld_workflowstatusdisp,
       A.ld_language,
       A.ld_pages,
       A.ld_color
FROM   ld_document A
       JOIN ld_folder FOLD
         ON A.ld_folderid = FOLD.ld_id
       LEFT OUTER JOIN ld_template C
                    ON A.ld_templateid = C.ld_id,
       ld_document_ext C1
WHERE  A.ld_deleted = 0
       AND A.ld_nature = 0
       AND NOT A.ld_status = 3
       AND A.ld_folderid = FOLD.ld_id
       AND A.ld_tenantid = 1
       AND A.ld_templateid = 102
       AND A.ld_docref IS NULL
       AND ((( C1.ld_docid = A.ld_id
               AND ( C1.ld_name = 'Keyword'
                      OR C1.ld_name LIKE 'Keyword-%' )
               AND C1.ld_stringvalue LIKE '%memento%' ))) 
			   
----------
Search by filename
1) From the form

select A.ld_id, A.ld_customid, A.ld_docref, A.ld_type, A.ld_version, A.ld_lastmodified, A.ld_date, A.ld_publisher, A.ld_creation, A.ld_creator, A.ld_filesize, A.ld_immutable, A.ld_indexed, A.ld_lockuserid, A.ld_filename, A.ld_status, A.ld_signed, A.ld_rating, A.ld_fileversion, A.ld_comment, A.ld_workflowstatus, A.ld_startpublishing, A.ld_stoppublishing, A.ld_published, FOLD.ld_name, A.ld_folderid, A.ld_tgs tags, A.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, A.ld_stamped, A.ld_password, A.ld_workflowstatusdisp, A.ld_language, A.ld_pages, A.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id left outer join ld_template C on A.ld_templateid=C.ld_id where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_docref is null and ( (lower(A.ld_filename) like '%something%')) UNION select A.ld_id, REF.ld_customid, A.ld_docref, A.ld_type, REF.ld_version, REF.ld_lastmodified, REF.ld_date, REF.ld_publisher, REF.ld_creation, REF.ld_creator, REF.ld_filesize, REF.ld_immutable, REF.ld_indexed, REF.ld_lockuserid, A.ld_filename, REF.ld_status, REF.ld_signed, REF.ld_rating, REF.ld_fileversion, A.ld_comment, REF.ld_workflowstatus, REF.ld_startpublishing, REF.ld_stoppublishing, REF.ld_published, FOLD.ld_name, A.ld_folderid, REF.ld_tgs tags, REF.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, REF.ld_stamped, REF.ld_password, REF.ld_workflowstatusdisp, REF.ld_language, REF.ld_pages, REF.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id join ld_document REF on A.ld_docref=REF.ld_id left outer join ld_template C on REF.ld_templateid=C.ld_id where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_docref is not null and REF.ld_deleted=0 and A.ld_docref = REF.ld_id and ( (lower(REF.ld_filename) like '%something%'))

2) From the saved query:
select A.ld_id, A.ld_customid, A.ld_docref, A.ld_type, A.ld_version, A.ld_lastmodified, A.ld_date, A.ld_publisher, A.ld_creation, A.ld_creator, A.ld_filesize, A.ld_immutable, A.ld_indexed, A.ld_lockuserid, A.ld_filename, A.ld_status, A.ld_signed, A.ld_rating, A.ld_fileversion, A.ld_comment, A.ld_workflowstatus, A.ld_startpublishing, A.ld_stoppublishing, A.ld_published, FOLD.ld_name, A.ld_folderid, A.ld_tgs tags, A.ld_templateid, C.ld_name, A.ld_tenantid, A.ld_docreftype, A.ld_stamped, A.ld_password, A.ld_workflowstatusdisp, A.ld_language, A.ld_pages, A.ld_color from ld_document A join ld_folder FOLD on A.ld_folderid=FOLD.ld_id left outer join ld_template C on A.ld_templateid=C.ld_id where A.ld_deleted=0 and A.ld_nature=0 and not A.ld_status = 3 and A.ld_folderid=FOLD.ld_id and A.ld_tenantid=1 and A.ld_docref is null and ( (A.ld_filename like '%something%'))

1) Takes in consideration the aliases and the lowercase
2) Execute a query without the options above