I added DC:Format metadata values to all collections, then reindexed the search.
When I use advanced search (default form, nothing custom in theme), it does not return any values if I set “Format”
“is exactly” > e.g., “Pocket Notebook”.
DC:Format (42) is also in use for items, but all fields contain blank or an integer.
The URL of advanced search is /items/search. The tab is “Search Items”. I see you can search “within a collection” via drop-down. But how can you search collection metadata? There must be some secret code that is not built in to the UI. I don’t see anything obvious when I do Google Search as far as what’s in the Omeka Classic documentation either.
Actually, there really isn’t a good way to do the equivalent to the advanced search for items for collections… the data is exactly the same but there’s just never been a clamor (or really any requests at all that I can recall, though that could be inaccurate) for expanded search capabilities for the collections.
Code-wise the advanced search implementation lives on the Item’s table class. Factoring that out so it could apply to collections would probably be a pretty simple task… it just hasn’t been done. To a large extent this is an artifact of historical differences between Collections and Items; Collections originally only had a static set of metadata and were converted to use the full metadata system significantly later on in Omeka’s development.
Omeka S doesn’t repeat this: items, sets, and media have the same “advanced” options (and largely the same options in general).
In terms of solutions now: a plugin could provide such filtering capability, since things are really the same on the SQL side of things.
Of course the core can be updated to provide the backend filtering an a UI to use it, but this would be in a future version, 2.7 hypothetically.
Thank you John! You just answered the question/discussion Paul and I were having this afternoon. If it’s a dead end in Omeka Classic, then now is the time to switch to Omeka-S vs. waiting for 3, 6, or 9 months.
Can you just confirm though - why does collection search exist at all? You can turn it on in search settings, you can index it. But it’s only for basic keyword search? Not advanced search? And no hooks exist to translate a URL query string into querying the collection metadata (which is in the same table omeka_elements_texts as the item metadata). Is it just an artificial limit added on in the search code to only apply the search to items and not collections? Because when I tell the advanced search to search “Format” “is exactly” value, the element_id 42 is the same regardless of whether it is collection record_type or item.
The search options you’re referring to are for the “site-wide” search, the one accessible from the “global” search bar on the admin and public sides. The sitewide search works using MySQL’s fulltext indexing and a separate table (the one MyISAM table in a normal current Omeka Classic installation; required for the older versions of MySQL we support to allow fulltext indexing). This is also the only thing the “reindex” button affects; the “advanced” search is a completely parallel, older, record-specific system.
You can hook into a request using a plugin hook/filter and grab a query string parameter and use it to query against the element_texts table to do an “advanced” search for collections. As you say, the structure and storage is exactly the same. This is the plugin option I referred to above.