问题描述
我在heroku上将解析服务器与mlab一起使用,我链接了两个表1. Artist 2. Offer
每个报价都有一个指针列artist
。
我已经创建了文本索引,这是视图:
"v": 2,"key": {
"_fts": "text","_ftsx": 1
},"name": "OfferSearchIndex","ns": "heroku_46tdsp6m.Offer","weights": {
"_p_artist": 1,"_p_artist.firstname": 1,"_p_artist.lastname": 1,"category": 1,"drscription": 1,"drscription_de": 1,"drscription_fr": 1,"drscription_it": 1,"drscription_ru": 1,"medium": 1,"movement": 1,"title": 1,"title_de": 1,"title_fr": 1,"title_it": 1,"title_ru": 1
},"default_language": "english","language_override": "language","textIndexVersion": 3
}
var offerQuery = new Parse.Query("Offer");
offerQuery.include('artist');
offerQuery.fullText('artist.firstname',request.params.wildcard);
return offerQuery.find({
useMasterKey: true
},function(error) {
console.log('#getofferForAdmin error 1',error);
return error;
})
但是此查询未根据艺术家的名字和姓氏搜索报价。它仅返回与商品标题,商品说明匹配的那些记录。
我使用以下命令在dex中创建一个
db.Offer.createIndex( { "_p_artist": "text","_p_artist.firstname": "text","_p_artist.lastname": "text",title: "text",title_de: "text",title_fr: "text",title_it: "text",title_ru: "text",drscription: "text",drscription_de: "text",drscription_fr: "text",drscription_it: "text",drscription_ru: "text",category: "text",medium: "text",movement: "text" },{name:"OfferSearchIndex"},{ default_language:"none" } )
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)