1

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" />

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

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

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?

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

Regards, T

Tom_LK
  • 113
  • 1
  • 2
  • 7

2 Answers2

2

Use RealTimeGet (Solr >= 4.0).

http://localhost:8983/solr/get?ids=1,2
juan
  • 1,917
  • 2
  • 16
  • 14
1

As the ids are unique do not search over it. The search performance will always be slower.
Try to use filter queries e.g. fq=doc_id:235
This would allow Solr to use filtercache and giving you a much improved performance.

Jayendra
  • 52,349
  • 4
  • 80
  • 90
  • I tried the two options: **1.** `q=doc_id:("...", "..."...)` **2.** `q=*:*&fq=doc_id:("...", "...", ...)` - this is **50%** slower. Any Ideas, how to improve performance when search by id – Tom_LK Dec 13 '11 at 15:53
  • Solr 4.10 and Heliosearch .07 have added a terms query (or terms filter) to more efficiently match many terms in a single field. http://yonik.com/solr-terms-query/ – hillmark Dec 31 '15 at 13:00