ดังที่ฉันทราบ ตั้งแต่เวอร์ชัน 3.8.9 พังพอนรองรับการค้นหาข้อความแบบเต็ม แต่ฉันไม่พบเอกสารที่ดีสำหรับมัน!
ฉันต้องการดำเนินการดังนี้:
db.collection.ensureIndex(
// Fields to index
{
animal: "text",
color: "text",
pattern: "text",
size: "text"
},
// Options
{
name: "best_match_index",
// Adjust field weights (default is 1)
weights: {
animal: 5, // Most relevant search field
size: 4 // Also relevant
}
}
)
กับพังพอนบริสุทธิ์ทำได้ไหม? หรือฉันต้องใช้ปลั๊กอินบางตัวเช่น mongoose-text-search? ถ้าไม่มีน้ำหนักล่ะ
แล้วจะทำยังไงล่ะ?
index
บนสคีมาเพื่อเพิ่มดัชนีข้อความหรือไม่ - person JohnnyHK   schedule 12.07.2014index
ของสคีมาของคุณ mongoosejs.com/docs/api.html#schema_Schema-index - person JohnnyHK   schedule 13.07.2014