couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Barnes <>
Subject Re: View Efficency
Date Tue, 29 Jun 2010 13:04:03 GMT
As Daniel Truemper said, couchdb-lucene is what you want for any kind of 
partial matching capability. A couchdb-lucene query can also be crafted 
to match A OR B.

If you only want a straight OR match, for instance "show me documents 
where is '0102010' or '0102014'", then the simplest thing to 
do is probably to run two queries and merge client-side.


On 29/06/2010 8:47 PM, Behrad Zari wrote:
> Dear Couchee's,
> Consider a search page which has N search keys on a specific doc type and we
> should support OR-logic permutations of these search keys based on user input!
> To support these we should write Views which index these N keys like:
> emit( [key1, key2,...], null )
> but since view keys are ordered we can't search with this query:
> key2==value2 || key4==value4
> For this to happen, we may write a view for each permutation! (multi-view
> technique)
> OR
> emit keys like this:
> emit( [first, key1, key2,...], null )
> emit( [second, key2, ...], null )
> Then we have a single large view.
> My question is:
> 1) Which solution is more query-effective with regards to data retrieval?
> 2) Is there any other way to support advanced-runtime searches through permanent
> views?
> --Behrad

View raw message