Skip to end of metadata
Go to start of metadata

Search functionality in the new CollectionSpace UI is taking shape, with the implementation of keyword search nearly complete. The new UI includes significant improvements to search, making search results more usable and easier to customize.


Result columns based on record type

CollectionSpace is able to perform searches on a single record type, but currently the search results must be displayed in the same way for every record type, making them less understandable.

Here's an example of a search on cataloging (object) records in CollectionSpace 4.4:

Here's an example of a search on group records:

The result tables in both of these searches have identical column headers, and the same number of columns. This is a restriction of the UI, and it can lead to confusion. For example, the first two column headers are labeled "ID Number" and "Summary", but these labels do not necessarily correspond to the names of any fields in the records. For object records, the "Summary" column actually contains data from the Title field. For group records, the "ID Number" column contains data from the Title field, and the "Summary" column contains data from the Group Owner field. "ID Number" and "Summary" are by necessity generic descriptors that could conceivably apply to any field in any record – and in the case of group records, "ID Number" turns out not to be generic enough, because the content is likely not even a number.

The Record Type column is another example of the limitations of this one-size-fits-all approach. That column is useful for searches that are not restricted to a single record type. But when a search is limited to a single record type, every row in the result table will contain the same value in that column: the record type that was searched. This makes it not very useful information that would better be replaced with another field, or simply removed to make more room for the other columns. That's not currently possible. Since the column should appear on searches for all record types, it must be present on searches for single record types as well.

These problems are solved in the new UI by making search results separately configurable for each record type, so that the most meaningful information can be displayed for each search context.

Here's what a search on object records looks like in CollectionSpace 5.0:

This is a search on group records:

Note that the headers of the first two columns in both result sets are labeled with the actual field names of their contents, and that there is no record type column.

Searches on all record types produce a different table:

Since the first two columns contain data pulled from different fields on different record types, the headers actually do have to be generic. Here "ID Number" has been replaced with the even more generic "Record", since the contents may be neither an ID nor a number. The Type column is now present, since it is useful in this context.


Formatted data

In the current UI, it's difficult to format the data returned in search results. This is evident in the contents of the "Updated At" column in the CollectionSpace 4.4 result sets. These values are not formatted in a user-friendly way. They're just timestamps pulled out of the database, formatted for machine-readability. In the CollectionSpace 5.0 result sets, the raw timestamps have been passed through a locale- and time zone-aware formatter. It's easy to configure a formatter to be applied to any search result column. This could either be a custom JavaScript function, or one of several built-in formatters. In addition to the timestamp formatter, other built-in formatters include: localization/translation of raw strings, as in the Type column in the All Records search; and extraction of display names from CollectionSpace ref names (URIs), as in the Owner column in the Groups search.

A formatter is not restricted to producing text. For example, the search result table for media handling records in CollectionSpace 5.0 looks like this:

In this case, the contents of the Thumbnail column are formatted from the blobCsid field for each media handling record. The output of the formatter is an image, retrieved from a URL that is computed from the value of blobCsid.


Try it out

This functionality is now available on the demo of the new UI at Currently, only keyword searches on All Record Types, Object, Group, and Media Handling work properly. Other record types have not been fully configured, so searches may not produce results.


1 Comment

  1. Looks great! Thanks for all of your work. These improvements are very much needed. What about adding columns to the returned search results, is that beyond scope?