documentcloud / visualsearch

A Rich Search Box for Real Data
http://documentcloud.github.com/visualsearch
MIT License
1.8k stars 237 forks source link

Updated VS.model.SearchQuery.find() #64

Closed corragon closed 12 years ago

corragon commented 12 years ago

Changes VS.model.SearchQuery.find() to return the facet object or undefined.

Previously it would return the value of the facet. It seems that a collection find() method should return a model instance (if found). This method isn't called anywhere else, so the change should allow easier programmatic access to facets in the searchQuery collection without introducing errors.

samuelclay commented 12 years ago

Unfortunately, this is a breaking API change. Also, if what you want is the internal data structure (the facet model), then feel free to directly address the facet collection and grab it.