couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: Newbie question: substring matching
Date Thu, 22 Jan 2009 18:19:53 GMT
On Thu, Jan 22, 2009 at 1:00 PM, Brian Candler <B.Candler@pobox.com> wrote:
> On Thu, Jan 22, 2009 at 12:08:39PM -0500, Paul Davis wrote:
>> Something you could try:
>>
>> emit(doc.field_to_search, value);
>> emit(string_reverse_function(doc.field_to_search), vaule);
>>
>> Then you could do something like:
>>
>> http://127.0.0.1:5984/db_name/_view/ddoc/using_like?startkey="foo"&endkey="foo\u9999"
>> http://127.0.0.1:5984/db_name/_view/ddoc/using_like?startkey="oof"&endkey="oof\u9999"
>>
>> And then intersect the two sets client side.
>
> I don't think I get this. As far as I can see, one set is values matching
> foo%, the other is values matching %foo.
>
> A string like "abcfoodef" isn't going to appear in either set, is it?
>

Oh. Touche. It sounded lots more clever in my head though. XD

Mime
View raw message