Riak Search. Ranges. Integer Analyzer Factory.

Alexander Sicular siculars at gmail.com
Sun Aug 19 19:03:42 EDT 2012


Ints are stored as 10 char padded strings. So int:11 is "0000000011". So 200 to 400 would be like [0000000200 TO 0000000400]. Try that. 


@siculars
http://siculars.posterous.com

Sent from my iRotaryPhone

On Aug 19, 2012, at 18:11, Vladimir Shapovalov <shapovalov at gmail.com> wrote:

> Hi all,
> 
> Does anybody know, how to query integers with wildcards and ranges? Currently I can get result with exact match only.
> 
> I've definded keynames with suffix _int (price_int).
> I use integer_analyzer_factory:
> ...
>         {dynamic_field, [
>             {name, "*_int"},
>             {type, integer},
>             {analyzer_factory, {erlang, text_analyzers, integer_analyzer_factory}}
>         ]},
> ...
> 
> I use curl for:
> 
> $: curl --globoff -v "http://localhost:8098/solr/bucket/select?wt=json&start=0&rows=0&q=price_int:[100 TO 200]" - no results.
> 
> $: curl --globoff -v "http://localhost:8098/solr/bucket/select?wt=json&start=0&rows=0&q=price_int:20*" - no results.
> 
> But if I change query to "q=price_int:200" I get result as expected. 
> 
> $: curl --globoff -v "http://localhost:8098/solr/bucket/select?wt=json&start=0&rows=0&q=price_int:200" - is available.
> 
> So there is definitelly a key with price:200 stored.
> 
> Could someone tell me what I'm doing wrong and how to deal with integers in riak-context correctly?
> 
> Thanks a lot in advance!
> Vladimir
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20120819/acfca7cf/attachment.html>


More information about the riak-users mailing list