Closed TechplexEngineer closed 7 years ago
Turns out what I was looking for was the fields option to the EasySearch.MongoDB engine.
http://matteodem.github.io/meteor-easy-search/docs/engines/#configuration
export default new EasySearch.Index({
collection: QA, //the collection to operate on
//the fields to search
fields: ['title', 'question', 'published.answer'],
engine: new EasySearch.MongoDB({
// ...
fields(searchObject, options)
{
//the fields to publish
return {question: 1, title: 1};
},
// ...
}),
});
Is there an easy way, hopefully one that I am missing, to limit the fields being published when using easy search with the mongodb engine?
I can manipulate the selector but all of the fields in the document are still returned.