# Duplicate Search Configuration
Per default, fields rhash
and rhash_sec
or a search filter for the raw hash are not displayed in the system.
If you want users to be able to search for image files with identical content in the GUI, we recommend configuring a search filter and adding field rhash
to the list views' "Sort-by" drop-down. A search result with identical files needs to be sorted by this field in order to display the duplicates next to each other.
# Search Filter Configuration
Configure a search renderer which a search for identical content in field rhash
like this:
<search_renderer>
<label>L-FILE-DUPLICATE-RAWHASH</label>
<label_placement>top</label_placement>
<search_additions>
<additions>
<condition operator="and">
<group>default</group>
<operator>=</operator>
<sql>(select count(f.id) from file_rhash_fc p left outer join file_rhash_fc c on p.`value` = c.`value` left outer join file f on c.pid = f.id where p.pid = file.id and f.deleted = 0) > 1</sql>
</condition>
</additions>
</search_additions>
<group_renderer_list>
<group_renderer>
<label>L-FILE-SEARCH-DUPLICATE-SEARCH-RAWHASH</label>
<type>flat</type>
<field_renderer_list>
<field_renderer>
<type>selection</type>
<label>L-FILE-MIMETYPE</label>
<placeholder>L-FILE-MIMETYPE_POP_UP_SELECTION</placeholder>
<comparator>IN</comparator>
<operator>AND</operator>
<field_renderer_attributes>
<entry key="visual_type" class="string">checkbox</entry>
<entry key="has_popup" class="boolean">true</entry>
<entry key="global_all" class="boolean">true</entry>
<entry key="group_all" class="boolean">true</entry>
</field_renderer_attributes>
<search_fields>
<search_field>
<name>mimetype</name>
</search_field>
</search_fields>
</field_renderer>
</field_renderer_list>
</group_renderer>
</group_renderer_list>
</search_renderer>
You can add this template to the Files module's object renderer set (more details (opens new window)).
Make sure to add translations for the label keys.
Result in the GUI:
# Sort-By Configuration
To offer the option to sort all found duplicates by their identical raw hash, you need to add field rhash
to the drop-down like this:
- Go to admin snap-in
Module configurations/Files/Object Renderer Sets
. - Open object renderer set "default" (or the set you added the search to).
- Go to panel "Object renderer for search and subpanel" and click the cog wheel icon next to "default".
- In section "search", scroll to field "Sort fields" and add field
rhash
from the reference find pop-up. Change its position in the list using drag-an-drop, if required. - Save your changes.
Result in the GUI:
Approach for Core Versions Before 4.0
Object Renderer Sets come with Core Engine version 4.0. If you work with former app versions, you need to add field rhash
to the sort-by drop-down via a layout change:
make a layout change for module Files' default main layout
default.4aplayout_c
in section
<entry class="array" key="sortFieldOptions">
, add the following:<!-- other sort-by fields --> <value class="map"> <entry key="label">L-FILE-SEARCH-DUPLICATE-SEARCH-RAWHASH</entry> <entry key="field">rhash</entry>
store your change in your custom folder
More information about creating changes and adding elements in Core version 3 can be found here (opens new window).
# Processor Configuration
New processor rawfilehash.xml
can be customized, if required. The default configuration is stored in folder modules/file/file_processors
. Possible actions are:
- limit the number of supported data types
- deactivate
strict_mode
(active by default)
More details about the strict mode can be found here.