One thing that I really miss in Omeka is possibility to describe items using additional metadata fields, other than text. It is possible to customize item metatdata fields, but I can only add and search text fields.
I'd like to add date fields to be able to search i.e. for items where date is "earlier than..." or "after..." some point in time. I'd also like to add a numeric field to record i.e price paid for an item or an item value, and be able to search for items that have values "less than" or "greater than" any number.
Currently I have possibility to record the additional data (like numbers, values, dates) but I can't search them, using conditions like "less than", "greater than", etc.
This features would be very helpful for many different collections, since people always buy, sell, exchange things in their collections, and it would be great to have all of this operations recorded and searchable.
Is this functionality possible to add with a plugin?
I'd agree, this isn't a strong suit for Omeka.
On the other hand, it is possible to add the kind of functionality you're talking about with a plugin. You can add things to the search form for the kinds of different searches you want.
The trick would be getting the data treated as the data type you want: a "real" number or date. Omeka stores all the element texts as strings, so MySQL sorts them lexicographically.
You can get around this by storing your data in a method that will sort correctly (the ISO 8601 date format works this way). You could also directly cast between datatypes in SQL, but that would defeat any indexing and end up being slow.
The alternative would be to create new tables that would store your numeric and date values with their "real" datatypes, then have the plugin query against those, instead of the element_texts table when searching or sorting.
Thanks for the helpful comments.
I considered writing a plugin as the best solution and it seems this is also your suggestion.
This would be my very first plugin for Omeka, so I'd need some exercise first. It won't be fast for me anyway.
Do you know any similar plugin that I could modify, to speed the things up? Or, maybe somebody has already started working on similar functionality?
The most important thing for me now is to have numeric fields searching. Dates can wait a bit longer.
How would MySQL sort strings with numbers?
For example, If I have the two following text strings that represent currency values: '120.5 EUR' and '124.65 EUR', the values should be sorted correctly. I'm not sure what would happen if I try to compare the strings some way?
Just wondering if you ever had any success with doing this?