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})