Mongodb精确短语搜索 [英] Mongodb exact phrase search

查看:65
本文介绍了Mongodb精确短语搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Mongodb文本搜索文档中了解到.
如果我要搜索Java or (coffee shop)
我需要像
{$text:{$search:"Java \"coffee shop\""}}
在mongodb文档中的精确短语搜索
因此它应该返回所有包含Java or (coffee shop)的文档.
但它的作用与Java and (coffee shop)完全相同.
所以我认为我没有从文档中得到正确的答案.
所以请
我为什么要得到这个结果需要明确的解释?

如何获得所需的输出Java or (coffee shop)?

解决方案

这是一个已知问题, 并正在SERVER-30163中进行跟踪. 尚未解决,因此请转到 SERVER-30163 对其进行投票.

As I understood from Mongodb documentation of text search.
if i want to search about Java or (coffee shop)
I need to do it like
{$text:{$search:"Java \"coffee shop\""}}
Exact Phrase search in mongodb documentation
so it should return all the documents contain Java or (coffee shop).
but it acts exactly as Java and (coffee shop).
so I think that i didn't get it right from the documentation.
so please.
I need clear explanation for why i got that result?
and
how to get the required output Java or (coffee shop)?

解决方案

This is a known issue, and is being tracker in SERVER-30163. Not Solved yet so please go to SERVER-30163 to up-vote it.

这篇关于Mongodb精确短语搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆