【发布时间】:2014-05-13 11:04:56
【问题描述】:
我正在运行一个 MongoDB (2.6.1) 实例并拥有数百万个文档,例如
t.save( { _id: 1, title: "Physics World", caption: "Physics World is the membership magazine of the Institute of Physics."} );
t.save( { _id: 2, title: "A break away!", caption: "'A break away!' is an 1891 painting by Australian main writer Tom Roberts."} );
t.save( { _id: 3, title: "Mahim Bora", caption: "Mahim Bora (b.1926) is an Indian main writer and educationist from Assam state."});
我还创建了一个索引,例如:
t.ensureIndex( { caption: "text" } );
然后我像这样搜索“主要作者”这个短语:
t.runCommand( "text", { search : "\"main writer\"", limit: 2000 } );
我遇到的问题是 Mongo 似乎只返回一条记录而不是两条。如果我将数据加载到 SOLR 中并将其编入索引以进行全文搜索,它将按预期工作。
这里有什么我可能会遗漏的吗?
【问题讨论】:
标签: mongodb solr full-text-search