Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
pymongo文本搜索MongoDB 4.4版_Mongodb_Full Text Search_Pymongo - Fatal编程技术网

pymongo文本搜索MongoDB 4.4版

pymongo文本搜索MongoDB 4.4版,mongodb,full-text-search,pymongo,Mongodb,Full Text Search,Pymongo,用于创建索引 我试过了 db.xxx.ensure_index([("title", "text")]) db.xxx.create_index([("title", "text")]) db.xxx.find({"$text": {"$search": SEARCH_TEXT}}) 用“太”尝试引用 用于文本搜索 我试过了 db.xxx.ensure_index([(&q

用于创建索引 我试过了

db.xxx.ensure_index([("title", "text")])
db.xxx.create_index([("title", "text")])
db.xxx.find({"$text": {"$search": SEARCH_TEXT}})
用“太”尝试引用

用于文本搜索 我试过了

db.xxx.ensure_index([("title", "text")])
db.xxx.create_index([("title", "text")])
db.xxx.find({"$text": {"$search": SEARCH_TEXT}})
用“太”尝试引用

不起作用。。。 我看了很多帖子和文档,但不知道为什么

这与我的字段内容的语言有关吗? 我的数据是韩文的。 或者我是否缺少任何预设置或导入

我的代码是:

@app.route('/api/search', methods =['POST'])
def title_search():
    title_receive = request.form['title_give']
    title_search = db.xxx.find({"$text": {"$search": title_receive}})
    result_title = db.xxx.find({'title': title_search})
    return jsonify({'result_title': result_title})