mongoid returns document not found even if its present + tire + mongoid -
i m using tire , mongoid in rails 4 application. class agent include mongoid::document include mongoid::timestamps include mongoid::taggable include tire::model::search include tire::model::callbacks ... mapping indexes :id, index: :not_analyzed indexes :name, type: 'string', analyzer: 'pattern' indexes :tags_array, type: 'string', analyzer: 'pattern' end ... def self.search(params) tire.search(load: true) query string "name:#{params}" string "tags_array:#{params}" end end end ... there 4 agents as agent.all.collect(&:tags) => ["pune", "pune", "press", "pune press"] agent.all.collect(&:name) => ["agent smith", "first", "second", "third"] i have 3 issues as 1) first problem agent not searchable 'name'. results = agent.search('first') ...