README.md in forty_facets-0.0.6 vs README.md in forty_facets-0.0.7

- old
+ new

@@ -97,9 +97,28 @@ - genre = facet_value.genre %li = link_to genre.name, filter.add(genre).path %span.count= "(#{facet_value.count})" ``` +## API + +### Base class + +To create a custom search subclass `FortyFacets::FacetSearch`. + +```ruby +class MySearch + model 'MyActiveRecordModel' # replace this with an class name from your models folder +end +``` + +### Available declaration methods +| keyword | options | | +|---------|---------------|-------------------------------------------------------------------------------------------------------------------------| +| text | prefix:true | creates a filter to limit search result to entities containing the filter value in the given field | +| facet | | creates a facetted filter on the specified model attribute (attribute or belongs_to) | +| range | | creates a range filter (param format 'FROM - TO') limiting result to entities with values in that range | +| orders | | takes a hash mapping a label to an argument that the active record `order` method can be called with to sort the result | ## FAQ ### Can I create filter for `has_many` associations ?