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:
type
is the type of the field. Must be one of [string
,integer
,datetime
,boolean
].name
can be any valid ruby identifier (i.e. must not start with a number or a Ruby reserved word).options
(all optional):search_boost
is an integer passed to Sunspot/Solr to increase the search relevance by the given factor. Default:1
.search_as
determines whether the field is can be searched a filter, fulltext, or both. Valid values are[:filter]
,[:fulltext]
or[:filter, :fulltext]
. Default:[]
.store
is a boolean value which determines whether the field is stored in the Mongo database or not. Default:true
.multi_value
is a boolean value which determines whether the value is stored as an array or single value. Default:false
.solr_name
is a string which is the name of the field in Solr. Default: field'sname
.
block
search_value
is a RubyProc
which 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