WHERE foo LIKE "% bar%" in CouchDB

What does a function like LIKE (and ILIKE) look like in CouchDB?

Not only if I want to search for "foo%", but also for "% foo%" or "% foo% bar%", etc.

+3
source share
1 answer

I assume that you want to have dynamic queries here, but unfortunately this cannot be done in the view. If you want a great, full-featured search solution, Lucene is the way to go.

Alternatively, you can use the function _list. You need to write a view to do basic filtering, perhaps with a parameter typeor something like that. In your list function, you will get access to query parameters. In this case, you can customize the reaction of your presentation depending on the parameters passed.

+2
source

Source: https://habr.com/ru/post/1791950/


All Articles