3 ms·
Hstore as part of a larger search index is really handy. We're using it at DocumentCloud to allow reporters to tag and search through their primary source docum
by jashkenas 15y ago
Hstore as part of a larger search index is really handy. We're using it at DocumentCloud to allow reporters to tag and search through their primary source documents by adding their own arbitrary metadata.
http://blog.documentcloud.org/blog/2011/05/arbitrary-metadata/ http://blog.documentcloud.org/blog/2011/05/arbitrary-metadat...
... when I search for "company:XTO" (or "company:*" for that matter), it can be serialized into an hstore query like so:
https://github.com/documentcloud/documentcloud/blob/master/lib/dc/search/query.rb#L311-330 https://github.com/documentcloud/documentcloud/blob/master/l...
... and then be used to build apps with hstore queries on top of the API, like this:
http://www.nytimes.com/interactive/2011/12/02/us/oil-and-gas-leases.html http://www.nytimes.com/interactive/2011/12/02/us/oil-and-gas...
... all without ever having to change the database schema, or indexes.