Jan Lehnardt wrote:
I want to store books in couchdb with each book having title, authors,
isbn, lccn, publisher and many other fields.
I would like to be able to query the system for any combination of
these. some thing like:
type="book" and publisher="foo" and author="bar
type="book" and isbn="1234567890"
How to do this in couchdb?
http://www.cmlenz.net/archives/2007/10/couchdb-joins
I would also suggest looking at the couchdb-lucene project:
http://github.com/rnewson/couchdb-lucene/tree/master
I found that it's pretty easy to get up and running, and it seems to
index your documents based on their top-level keys. So your example of
searching "type:book publisher:foo author:bar" might fit quite well.
(Also, sorry to post across threads, but ISBN is most certainly *not
necessarily unique* per book! It may be unique for a title (i.e. some
text by some author distributed by some publisher), but of course all
printings of that title have the same ISBN. For example, a book
inventory application may opt to use one document per book, thereby
having several documents with the same ISBN.)
--
Jason Smith
Proven Corporation
Bangkok, Thailand
http://www.proven-corporation.com