Supplejack : Schema DSL (Domain Specific Language)
Schema DSL (Domain Specific Language)
Fields
Fields are defined using the following syntax:
type name options do block end where:
typeis the type of the field. Must be one of [string,integer,datetime,boolean].namecan be any valid ruby identifier (i.e. must not start with a number or a Ruby reserved word).options(all optional):search_boostis an integer passed to Sunspot/Solr to increase the search relevance by the given factor. Default:1.search_asdetermines whether the field is can be searched a filter, fulltext, or both. Valid values are[:filter],[:fulltext]or[:filter, :fulltext]. Default:[].storeis a boolean value which determines whether the field is stored in the Mongo database or not. Default:true.multi_valueis a boolean value which determines whether the value is stored as an array or single value. Default:false.solr_nameis a string which is the name of the field in Solr. Default: field'sname.
blocksearch_valueis a RubyProcwhich produces the value which should be indexed by Solr. The block is executed when the field is indexed. Must be the same type as the field'stype. Default:nil.
Read full article from Supplejack : Schema DSL (Domain Specific Language)
No comments:
Post a Comment