使用haskell驱动程序进行MongoDB全文搜索 [英] MongoDB full text search with haskell driver

查看:121
本文介绍了使用haskell驱动程序进行MongoDB全文搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在haskell API中找到了'runCommand',但它期望一个可以使用mongoDB的全文搜索的haskell驱动程序。文档作为参数。对于mongodb可以运行的所有其他命令来说,这很好,但是文本命令的语法是:
db.collection.runCommand(text,{search:something})



所以我不知道如何将文本作为文档前面的第一个参数。



谢谢

解决方案

文本 -command可以用另一种结构编写:

  {text:your_collection 
,搜索:your_text
,过滤器:your_filter
,限制:your_limit
,项目:your_projection
}

我有我的怀疑,因为所有runCommand-action都具有相同的结构。所以我试图将这种结构应用于文本命令 - 但没有成功。然后我记得 aggregate 也有另外一个结构,并且尝试过,但那也不起作用。最后,我在Java驱动程序的 Google小组条目中找到答案


Is there a possibility to use the full text search of mongoDB with the haskell driver?

I found the 'runCommand' in the haskell API, but it expects a Document as parameter. That's fine for all the other commands that mongodb can run, but the syntax for a text command is: db.collection.runCommand( "text", {search : "something"})

So I don't know how I'll get the "text" as first parameter in front of the Document.

Thanks

解决方案

The text-command can be written in another structure:

{ text: your_collection
, search: your_text
, filter: your_filter
, limit: your_limit
, project: your_projection
} 

I had my suspicion, since all "runCommand"-action have the same structure. So I tried to apply that structure to the text-command - but without success. Then I remembered that aggregate has another structure too and tried that, but that didn't work either. Finally, I found the answer in a google group entry of the Java driver.

这篇关于使用haskell驱动程序进行MongoDB全文搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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