Mongo2.6文本搜索疯了

2024-04-18 04:17:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我在2.6上使用Mongodb文本搜索。对于这个案子,Mongodb完全是疯了。我肯定这是个虫子。你知道吗

我正在运行两个这样的查询

db.command(
                    'text',
                    'tweets',
                    search='kejriwal ak4pm arvindkejriwal arvind',
                    limit=500000,
                    project={'_id': 1, 'rT': 1, 'ts': 1},
                    # filter=basicFilterQuery
                )['results']

此查询将给我0个结果。你知道吗

但是当我运行这个查询时:

db.command(
                        'text',
                        'tweets',
                        search='kejriwal ak4pm arvind',
                        limit=500000,
                        project={'_id': 1, 'rT': 1, 'ts': 1},
                        # filter=basicFilterQuery
                    )['results'] 

这个查询给了我15K个结果**。你知道吗

这在我看来是错误的,因为第一个查询字符串比第二个查询字符串更具包容性,应该返回更多文档。你知道吗

有人能告诉我这里发生了什么事吗?你知道吗


Tags: textprojectiddbsearchmongodbfiltercommand