0

I am trying to retrieve 5000 records from Raven DB at a stretch by using the below code. I am trying with single session.

documentIDsList : contains list of id's to be fetched from Raven. Right now it has 5000 string values in this list.
session.Query().Where(k => k.Id.In(documentIDsList)).ToList();

Problems I am Facing :

  • Request URI Too Long
  • Linq expression type Not Supported

Please help me on how the query should be written to retrive more records at a stretch.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
Ujjwal27
  • 1,103
  • 3
  • 15
  • 31
  • Not sure I would call this a duplicated question as it really isn't ALL the same as the question with the "answer". The major problem here is that the query that get passed to Raven via a HTTP/GET gets too long due to the fact that documentIDsList got 5000 string values. It's like building a URL (the query against Ravens API) with more than 5000 characters and that's not supported... – Jens Pettersson Jun 03 '15 at 06:31
  • There is a convention named MaxLengthOfQueryUsingGetUrl on the documentstore that lets you change the length, but I know it has a limit. Another way is that you trick the get request in executing as a multi-get (http://ayende.com/blog/63489/ravendb-multi-get-support). The request will get executed as a POST with the url in the body. In order to do a multi-get you need to use .Lazily() in the query (see https://github.com/ravendb/ravendb/blob/master/Raven.Tests/MultiGet/MultiGetQueries.cs) – nickvane Jun 03 '15 at 19:15

0 Answers0