Hide useless fields in advanced search


I would like to hide all fields which are not used in the advanced search form.

In omeka classic, it is possible to edit application/views/scripts/items/search-form.php but I cannot find anything similar for Omeka S.

I tested the module “Custom Advanced Search” but it adds only the possibility to insert a text before the form.


There is a pull request on github for that: https://github.com/omeka/omeka-s/pull/1185


You want to take out entire fields (like the Class selector), or make changes to the ones that are there, or both?

Removing them completely is already possible with the current event there, just not currently implemented in Custom Advanced Search.


Hi Jflatness and Daniel_KM,

I just want to have only the fields that are actually used (that is to say the ones with at least one item which used them).

So I guess it is “take out entire fields” choice. An automatic way to do this would be great. If you are concern with the api query and the performance impact (cf. github pull request linked in Daniel post), at least an manual option to select fields we want (like reference module) would be a start.

With omeka S and the ability to import ontologies, there are so many fields it is impossible to use efficiently advanced search. For example, I added the schema.org ontology just for using several fields, all of them are available in advanced search which make no sense.



How to go about customizing Advanced Search on a per Site basis? We have project here that wants to lean heavily on Advanced Search (not Pages/Exhibition) and needs some changes.



Actually, it’s occurring to me that I can do what needs to be done by just embedding a custom HTML form into a page that posts to the Advanced Search endpoint with hidden field values:

<div class="advanced-search-content">

<form id="symonds-search" method="get" action="/omeka-s/s/symonds-library/item">

<input aria-label="Query text" class="query-text" name="property[0][text]" type="text" value="" />
<input class="joiner" name="property[0][joiner]" type="hidden" value="and" />
<input aria-label="Property" class="query-property" name="property[0][property]" type="hidden" value="" />
<input aria-label="Query type" class="query-type" name="property[0][type]" type="hidden" value="in" />
<input aria-labelledby="by-item-set-label" name="item_set_id[]" type="hidden" value="310" />
<input aria-labelledby="by-item-set-label" name="item_set_id[]" type="hidden" value="1004" />
<input name="resource_template_id[]" type="hidden" value="3" />

<input name="submit" type="submit" value="Search" />



And yet, whenever I save this form, the WYSIWYG editor strips out my FORM tags. No fair!




If you use Omeka-S v1.3.0+, have you tried enabling the Search option named “Restrict to templates” in your site settings?
It does not restrict search fields to thoses only used, but you can set a selection based on resource templates.
Ultimately, you can create a resource template that contains only the fields you want and use it for this purpose.


@ManOnDaMoon I don’t have this option on my Omeka 1.4.0 installation.


Are you sure? It is located in a site specific settings, be careful not to look in Omeka S global settings:

You’ll find a ‘Search’ section where you’ll have to select the resource template with the fields you want to filter, and then tick the option below:


Ok, this is happening because I use the Search module which replaces this part of the site settings.
I reported the bug:



We have a Resource Template consisting of 16 Dublin Core fields.

In our Site Settings --> Search I have selected it and clicked on Restrict to templates.

Am I to expect, now, that when I go to Advanced Search for this site I will see a form with textboxes for our 16 Dublin Core fields and the ability to Sort on any one of them? I do not.

A quick question: How can we, in Advanced Search, Sort by DC: Creator?





When you go to advanced search on your site, you will see that the « Search by value » list is now only built using your 16 DC fields.
I’m not sure but I think there is a way to modify the Advanced Search URL in order to setup per-existing fields in the advanced search form, like I’m doing it’s this link: https://omekas.manondamoon.com/s/demo/item/search?property[0][joiner]=and&property[0][property]=225&property[0][type]=in&property[0][text]=Test&property[1][joiner]=or&property[1][property]=4&property[1][type]=in&property[1][text]=Test2&resource_class_id[]=121&item_set_id[]=7&resource_template_id[]=7


Thanks again. And I see what you’re saying. That Restrict to Templates thing is working for me.

BUT is there any way to (hopefully by default) Sort by Creator? The sort dropdown only contains Created, Title, Identifier, and Class. Not very useful. Basically, I think if we could simply set the default sort to Creator, Ascending, this would do what we want it to do. Forcing a sort of dc:creator asc on the URL string brings no joy!



Actually, I think the Search module may do what I want:

But for the life of me I can’t parse this instruction:

Add a page named Internal search or whatever you want, a path to access it, for example search or find , the index that was created in the previous step ( Internal here), and a form adapter ( Basic ) that will do the mapping between the form and the index. Forms added by modules can manage an advanced input field and/or filters.

Does anyone know of more fleshed out instructions for this module? It sure does seem like the intent of it is to facilitate the creation of custom search forms on a per site basis (although it doesn’t actually say that).



Dear all,

I have been reading with attention your comments. I work on Omeka-s 1.4.0.

My wish is to limit fields in the public advanced search menu i.e to delete from the menu some properties event if they do exist on the administrative side.

I also wish to delete the field “search by class” which is useless in my case.

And last request, I wish to limit the public query to some item-sets.

I used the site settings in order to limit items sets search as described above.
I also ckick on the button restrict templates.

However when I go public view, I still have access to all items-sets on the fields " Search by items-sets".

I also red the link thttps://github.com/omeka/omeka-s/pull/1185 in order to adapt php.files.
However as my files doest not strictly correspond to those on Github and specially the variable " $isOptionUsed", doest not exist in the files, I have not been able to change the advanced search as we wanted to.

My last error message was : ( Zend\View\Exception\RuntimeException Zend\View\Renderer\PhpRenderer::render: Unable … ).

I thank you in advance if you can tell how I can proceed.
Sincerely Yours,