incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Wright <...@inflatablecookie.com>
Subject Optionally including docs in view results
Date Mon, 04 Aug 2008 18:31:37 GMT
Hi all.

I'm currently building a search engine with couch. The search criteria 
is particularly complicated, so a view is generated at search-time, with 
the bare minimum information emitted (if it hasn't been indexed already).
This all works fine, however trying to display the results introduces a 
seemingly unnecessary overhead..

Because there will potentially be a lot of views, emitting the whole 
document isn't really an option as way too much disk space will be 
wasted. Currently, the only other option is to iterate through the view 
results and query each hit individually for the full document body. As 
I'm working in PHP, there's a fairly substantial crunch involved in 
querying a large number of single records in a loop.

Is there a way (or is a way planned) for the documents to be optionally 
attached to a view's result rows via a query string argument?

Example:

/my_db/_view/my_design_doc/my_view?include_docs=true

produces

"rows":
[{
"id":"id",
"key": "key"
"value": { "my_emitted_data":123 }
"doc": { -- document data here -- }
},
{
etc..
}]

I know this is a relatively edge case.. it'd be really handy to have though!
Any thoughts / suggestions?

Cheers
Tom


Mime
View raw message