I'm following the tutorial instruction: https://docs.mongodb.com/manual/core/index-text/
This is the sample data:
db.stores.insert(
[
{ _id: 1, name: "Java Hut", description: "Coffee and cakes" },
{ _id: 2, name: "Burger Buns", description: "Gourmet hamburgers" },
{ _id: 3, name: "Coffee Shop", description: "Just coffee" },
{ _id: 4, name: "Clothes Clothes Clothes", description: "Discount clothing" },
{ _id: 5, name: "Java Shopping", description: "Indonesian goods" }
]
)
Case 1: db.stores.find( { $text: { $search: "java coffee shop" } } )
=> FOUND
Case 2: db.stores.find( { $text: { $search: "java" } } )
=> FOUND
Case 3: db.stores.find( { $text: { $search: "coff" } } )
=> NOT FOUND
I'm expecting case 3 is FOUND because the query is matches a part of java coffee shop