Search documents in a date range

Hello,
I am building a catalogue where we use the dublin core field date. I need to be able to search documents by date, although omeka , in the advance search options, takes the date field as text, so it is imposible to, for example, search documents between 2 dates, or older than a date, etc.

Is there any way to activate an option to search into the date field by range of dates, or older than, newer than, etc?

Thanks in advance

I believe you would need to a) create a custom plugin capable of searching by date range (e.g. using a custom form/fieldset) and b) normalize all the date strings in your database so they are in a common standard format (and maybe develop another plugin so that formatted dates are always used going forward). Basically, I don’t think there is any way to do this without writing a lot of code.

I finally found a solution.
We need to use two plugins together

I created two new elements I called: “year start” and “year end”, I guess you can also create two new dublin core fields and use them: the key is that they will hold the data of the YEAR (date) and that you need two, a start and an end. they don’t have to be filled (both)

plugins used:

  • AvantCommon: here you need to edit the configuration and fill the fields, “start year” and “end year” with the names of you created elements
  • AvantSearch to modify advance search fields: now a new option appears to search by date (years)

the two modules are well documented, and is quite easy.

1 Like

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.