Skip to content
This repository

"foo is not a valid view" when database contains no documents #7

Closed
ozzilee opened this Issue · 3 comments

2 participants

ozzilee Robert Newson
ozzilee

Trying to search a database that contains no documents (besides the couchdb-lucene design document) brings up the error "foo is not a valid view." This is misleading, as the view works properly when there are documents in the database.

Robert Newson
Owner

You're right, of course.

The "not a valid view" message ought to be temporary, since adding a fulltext member to a design document that causes nothing at all to be indexed is redundant.

I would very much like it return a valid JSON response (with zero hits, obviously) instead. The trick here is that only couchdb knows which views are legitimate until lucene contains at least one document, with the present code.

The purpose of returning "not a valid view" was to help developers understand when they got their url's right, as numerous people were complaining about "no hits" but were using the wrong URL.

I'll try to correct this issue without breaking those other cases.

ozzilee

Yeah, it's a bit of a corner case. Not stopping me from doing anything useful, just a bit of polish.

Robert Newson
Owner

Resolved on master.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.