1

I am trying to use ravendb (build 960) multi get to get the results of several queries.

I am posting to /multi_get with:

[
  {"Url":"/databases/myDb/indexes/composers?query=title:beethoven&fetch=title&fetch=biography"},
  {"Url":"/databases/myDb/indexes/products?query=title:beethoven&fetch=title&fetch=price"}
]

The server responds with results for each query, however it responds with EVERY document for each index. It looks like neither the query is used, or the fetch parameters.

Is there something I am doing wrong here?

Derek Ekins
  • 11,215
  • 6
  • 61
  • 71
  • Does it work correctly when you do a regular get for just one of the URLs? Can you tell us what build of the RavenDB server you are using? And can you post a small sample of the output? Thanks. – Matt Johnson-Pint Feb 15 '13 at 19:07
  • The output is a a bit hefty but each query has: { "Result": "{\"IdsToInclude\":[],\"Results\":[{... snip ...}] "Headers": { "Raven-Server-Build": "960", "ETag": "78a73e24-1c46-f055-f03f-700a07892105", "Content-Type": "application/json; charset=utf-8", "Temp-Request-Time": "26 ms" }, "Status": 200 } – Derek Ekins Feb 18 '13 at 06:09

1 Answers1

1

Multi GET assumes all the urls are local to the current database, you can specify urls starting with /datbases/foo You specify that in the multi get url. Change you code to generate:

[
  {"Url":"/indexes/composers?query=title:beethoven&fetch=title&fetch=biography"},
  {"Url":"/indexes/products?query=title:beethoven&fetch=title&fetch=price"}
]

And make sure that you multi get goes to

/databases/mydb/multi_get
Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • This is definetely using the query params now, but it is still not fetching the specified fields. Updated the question to include the build number (960) if that helps (I realise it is old.. on a slow upgrade path)! – Derek Ekins Feb 18 '13 at 06:12