开发者

WHERE foo LIKE "%bar%" in CouchDB

开发者 https://www.devze.com 2023-02-10 03:29 出处:网络
How would a funktion similar to LIKE (and ILIKE) looks like in CouchD开发者_开发百科B? Not only if I want to search for \"foo%\" but also for \"%foo%\" or \"%foo%bar%\" and so onI\'m presuming you wa

How would a funktion similar to LIKE (and ILIKE) looks like in CouchD开发者_开发百科B?

Not only if I want to search for "foo%" but also for "%foo%" or "%foo%bar%" and so on


I'm presuming you want to have dynamic queries here, but that unfortunately can't be done in a view. If you want a great, full-featured search solution, Lucene will be the way to go.

Alternatively, you could use a _list function. You would write up a view to do some basic filtering, probably by a type parameter or something of that nature. Within your list function, you'll have access to the query parameters. With that, you can customize the response of your view depending on the parameters passed.

0

精彩评论

暂无评论...
验证码 换一张
取 消