Hey,
I’m sorry, I speak a little English.
This is my PHP code:
$questions = $mongo->find_array('faq_questions',
array(
'$text' => array(
'$search' => 'pénz',
'$caseSensitive' => false,
'$diacriticSensitive' => true
),
), array(
'projection' => array('score' => array('$meta' => 'textScore')),
'sort' => array('score' => array('$meta' => 'textScore')),
)
);
It works, but not fully. Mongo version: 3.6.8
My data in faq_questions collection:
_id question answer
658eb9d5a663443da35493c2 pénz etc
658ee1dda663443da35493c3 papírpénz xyz
658eedf8a663443da35493c4 pénzcsipesz abc
The result only 1, the first: “pénz”
… but I would like see all (3).
My index creation:
db.faq_questions.createIndex(
{
question: "text",
answer: "text"
},
{
default_language: "hungarian",
weights: {
question: 10,
answer: 5
},
name: "text_index"
}
);
Please help me. Thanks.