cmusatyalab / opendiamond

Interactive search of non-indexed data
http://diamond.cs.cmu.edu/
Eclipse Public License 1.0
19 stars 9 forks source link

Allow scopelist <object> elements to specify initial attributes #36

Open bgilbert opened 11 years ago

bgilbert commented 11 years ago

Add an optional attrs="URL" attribute to <object> elements, where the URL points to a JSON document containing initial attributes (similar to the X-Attributes object header). This will allow web applications to store initial attributes in their databases but keep the objects themselves in S3.

Initial attributes may change over time, but the result cache currently assumes they won't so it can perform drop calculations before fetching an object. However, this change would give us a reference to the initial attributes before drop decisions are made. _ObjectFetcher should override get_cache_key() to hash in the attributes URL from the scopelist. The dataretriever can then append a query string containing an attribute serial number or hash, ensuring that if the initial attributes change, diamondd will notice this even on cached results.