按id搜索文档很慢 [英] Search document by id very slow

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

问题描述

我的文档有一个id字段,名为doc_id,声明具有以下属性:

my documents has an id field, called "doc_id", declared with the following attributes:

<field name="doc_id" type="long" indexed="true" stored="true" required="true" />

此ID被标记为带有标签的唯一键。

This id is marked as an unique key with the tag.

我试图一次加载许多文档,给他们的id在请求fe doc_id:(235,163,256,...,10473)

I try to load many documents at once, giving their ids in request f.e. doc_id:(235, 163, 256, ..., 10473)

查询中的标识符计数永远不会大于100.但是,在存储中,此查询执行所需的时间会更长。我认为这将是一个像SQL查询f.e。 select doc where doc_id in(...)但索引为doc_id的执行时间应该是常量,应该不是吗?

The count of identifiers in the query is never greater than 100. However, the more documents are there in the storage the longer it takes for this query to execute. I thought this would be something like the SQL query f.e. "select doc where doc_id in (...)" but with index on "doc_id" the execution time should be constant, shouldn't it? So why is it slowing down in solandra after I add more and more docs?

我使用Solandra(Solr 3.4 + Cassandra 1.0.3)

I'm working with Solandra (Solr 3.4 + Cassandra 1.0.3)

尊敬的,

推荐答案

使用 RealTimeGet (Solr> = 4.0)。

Use RealTimeGet (Solr >= 4.0).

http://localhost:8983/solr/get?ids=1,2

这篇关于按id搜索文档很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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