Re: Riak search on an index limited to only 1 bucket
Oh, nice snippets! thanks Drew! Alex On Fri, May 13, 2016 at 11:28 PM, Drew Kerriganwrote: > @Alex please kindly take a look at the default solr schema for Riak > Search. You should have based your custom schema on this (if you've created > a custom schema): > https://docs.basho.com/riak/kv/2.1.4/developing/usage/search-schemas/ -> > https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml > > Specifically take a look at these lines: > https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L124-L131 > (This > is where the _yz_rt/rb/rk are defined to be indexed) > > And these: > https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L101-L104 > - > These dynamic fields catch all Riak DTs because the solr field names of > data types automatically get their type name appended to the end (as you > noticed with your reference to "*likes_counter" *in your own index). > > As you can see in the default schema, all sets are automatically indexed > as multivalued. > > Hopefully this info takes away some of the magic for you ;-) > > Drew > > On Fri, May 13, 2016 at 12:16 PM Vitaly <13vitam...@gmail.com> wrote: > >> In general, Riak/Solr is capable of indexing multi-valued properties >> (i.g. lists). You're right thinking that multiValued = "true" should be >> used for it. That said, check if it works with your client library (it's >> Python, isn't it?). I believe it does. >> >> Regards, >> Vitaly >> >> On Fri, May 13, 2016 at 9:59 PM, Alex De la rosa > > wrote: >> >>> Another question... if I have a set of tags for the elements... like >>> photo.set['tags'] with things like: ["holidays", "Hawaii", "2016"]... will >>> it be indexed like this? >>> >>> >> multiValued="true" /> >>> >>> Thanks, >>> Alex >>> >>> On Fri, May 13, 2016 at 10:52 PM, Alex De la rosa < >>> alex.rosa@gmail.com> wrote: >>> Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... thanks also for the "*:*" tip ; ) Thanks! Alex On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: > Hi Alex, > > 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results > to the photos bucket only. Similarly, "_yz_rt" is for a bucket type. > > Searching for anything in an index can be done with "*:*" (any field, > any value). > > Regards, > Vitaly > > On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa < > alex.rosa@gmail.com> wrote: > >> Hi all, >> >> Imaging I have an index called "*posts*" where I index the following >> fields >> >> >> > /> >> > stored="false" /> >> >> and I reuse the index in 3 buckets: "status", "photos" and >> "videos"... then I do the following: >> >> *results = client.fulltext_search('posts', 'likes_counter:[100 TO >> *]', sort='likes_counter desc', rows=10)* >> >> This query would give me the top10 most liked items (can be statuses, >> photos or videos) with at least 100 likes. But how could I limit the >> resultset to only the "photos" bucket?? The goal is to get the Top10 >> liked >> photos without creating an index for itself... as is good to also be able >> to query the top10 items in general. Any way to do it? >> >> In another hand... does somebody know how to do the same query but >> without the [100 TO *]?? I leave it empty? >> >> *results = client.fulltext_search('**posts**', '', >> sort='likes_counter desc', rows=10)* >> >> Thanks, >> Alex >> >> ___ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> > >>> >> ___ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
@Alex please kindly take a look at the default solr schema for Riak Search. You should have based your custom schema on this (if you've created a custom schema): https://docs.basho.com/riak/kv/2.1.4/developing/usage/search-schemas/ -> https://raw.githubusercontent.com/basho/yokozuna/develop/priv/default_schema.xml Specifically take a look at these lines: https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L124-L131 (This is where the _yz_rt/rb/rk are defined to be indexed) And these: https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L101-L104 - These dynamic fields catch all Riak DTs because the solr field names of data types automatically get their type name appended to the end (as you noticed with your reference to "*likes_counter" *in your own index). As you can see in the default schema, all sets are automatically indexed as multivalued. Hopefully this info takes away some of the magic for you ;-) Drew On Fri, May 13, 2016 at 12:16 PM Vitaly <13vitam...@gmail.com> wrote: > In general, Riak/Solr is capable of indexing multi-valued properties (i.g. > lists). You're right thinking that multiValued = "true" should be used for > it. That said, check if it works with your client library (it's Python, > isn't it?). I believe it does. > > Regards, > Vitaly > > On Fri, May 13, 2016 at 9:59 PM, Alex De la rosa> wrote: > >> Another question... if I have a set of tags for the elements... like >> photo.set['tags'] with things like: ["holidays", "Hawaii", "2016"]... will >> it be indexed like this? >> >> > multiValued="true" /> >> >> Thanks, >> Alex >> >> On Fri, May 13, 2016 at 10:52 PM, Alex De la rosa < >> alex.rosa@gmail.com> wrote: >> >>> Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... >>> >>> thanks also for the "*:*" tip ; ) >>> >>> Thanks! >>> Alex >>> >>> On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: >>> Hi Alex, 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to the photos bucket only. Similarly, "_yz_rt" is for a bucket type. Searching for anything in an index can be done with "*:*" (any field, any value). Regards, Vitaly On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa < alex.rosa@gmail.com> wrote: > Hi all, > > Imaging I have an index called "*posts*" where I index the following > fields > > > > stored="false" /> > > and I reuse the index in 3 buckets: "status", "photos" and "videos"... > then I do the following: > > *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', > sort='likes_counter desc', rows=10)* > > This query would give me the top10 most liked items (can be statuses, > photos or videos) with at least 100 likes. But how could I limit the > resultset to only the "photos" bucket?? The goal is to get the Top10 liked > photos without creating an index for itself... as is good to also be able > to query the top10 items in general. Any way to do it? > > In another hand... does somebody know how to do the same query but > without the [100 TO *]?? I leave it empty? > > *results = client.fulltext_search('**posts**', '', > sort='likes_counter desc', rows=10)* > > Thanks, > Alex > > ___ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > >>> >> > ___ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
Yes, using Python client. I'm able to store sets without problem into Riak, just wondered if indexing them in SOLR would be as simple as just adding the multiValued attribute to the "set" field... seems is going to be that way :) Thanks, Alex On Fri, May 13, 2016 at 11:15 PM, Vitaly <13vitam...@gmail.com> wrote: > In general, Riak/Solr is capable of indexing multi-valued properties (i.g. > lists). You're right thinking that multiValued = "true" should be used for > it. That said, check if it works with your client library (it's Python, > isn't it?). I believe it does. > > Regards, > Vitaly > > On Fri, May 13, 2016 at 9:59 PM, Alex De la rosa> wrote: > >> Another question... if I have a set of tags for the elements... like >> photo.set['tags'] with things like: ["holidays", "Hawaii", "2016"]... will >> it be indexed like this? >> >> > multiValued="true" /> >> >> Thanks, >> Alex >> >> On Fri, May 13, 2016 at 10:52 PM, Alex De la rosa < >> alex.rosa@gmail.com> wrote: >> >>> Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... >>> >>> thanks also for the "*:*" tip ; ) >>> >>> Thanks! >>> Alex >>> >>> On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: >>> Hi Alex, 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to the photos bucket only. Similarly, "_yz_rt" is for a bucket type. Searching for anything in an index can be done with "*:*" (any field, any value). Regards, Vitaly On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa < alex.rosa@gmail.com> wrote: > Hi all, > > Imaging I have an index called "*posts*" where I index the following > fields > > > > stored="false" /> > > and I reuse the index in 3 buckets: "status", "photos" and "videos"... > then I do the following: > > *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', > sort='likes_counter desc', rows=10)* > > This query would give me the top10 most liked items (can be statuses, > photos or videos) with at least 100 likes. But how could I limit the > resultset to only the "photos" bucket?? The goal is to get the Top10 liked > photos without creating an index for itself... as is good to also be able > to query the top10 items in general. Any way to do it? > > In another hand... does somebody know how to do the same query but > without the [100 TO *]?? I leave it empty? > > *results = client.fulltext_search('**posts**', '', > sort='likes_counter desc', rows=10)* > > Thanks, > Alex > > ___ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > >>> >> > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
In general, Riak/Solr is capable of indexing multi-valued properties (i.g. lists). You're right thinking that multiValued = "true" should be used for it. That said, check if it works with your client library (it's Python, isn't it?). I believe it does. Regards, Vitaly On Fri, May 13, 2016 at 9:59 PM, Alex De la rosawrote: > Another question... if I have a set of tags for the elements... like > photo.set['tags'] with things like: ["holidays", "Hawaii", "2016"]... will > it be indexed like this? > > multiValued="true" /> > > Thanks, > Alex > > On Fri, May 13, 2016 at 10:52 PM, Alex De la rosa > wrote: > >> Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... >> >> thanks also for the "*:*" tip ; ) >> >> Thanks! >> Alex >> >> On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: >> >>> Hi Alex, >>> >>> 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to >>> the photos bucket only. Similarly, "_yz_rt" is for a bucket type. >>> >>> Searching for anything in an index can be done with "*:*" (any field, >>> any value). >>> >>> Regards, >>> Vitaly >>> >>> On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa < >>> alex.rosa@gmail.com> wrote: >>> Hi all, Imaging I have an index called "*posts*" where I index the following fields >>> stored="false" /> and I reuse the index in 3 buckets: "status", "photos" and "videos"... then I do the following: *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', sort='likes_counter desc', rows=10)* This query would give me the top10 most liked items (can be statuses, photos or videos) with at least 100 likes. But how could I limit the resultset to only the "photos" bucket?? The goal is to get the Top10 liked photos without creating an index for itself... as is good to also be able to query the top10 items in general. Any way to do it? In another hand... does somebody know how to do the same query but without the [100 TO *]?? I leave it empty? *results = client.fulltext_search('**posts**', '', sort='likes_counter desc', rows=10)* Thanks, Alex ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>> >> > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
Another question... if I have a set of tags for the elements... like photo.set['tags'] with things like: ["holidays", "Hawaii", "2016"]... will it be indexed like this? Thanks, Alex On Fri, May 13, 2016 at 10:52 PM, Alex De la rosawrote: > Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... > > thanks also for the "*:*" tip ; ) > > Thanks! > Alex > > On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: > >> Hi Alex, >> >> 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to >> the photos bucket only. Similarly, "_yz_rt" is for a bucket type. >> >> Searching for anything in an index can be done with "*:*" (any field, >> any value). >> >> Regards, >> Vitaly >> >> On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa > > wrote: >> >>> Hi all, >>> >>> Imaging I have an index called "*posts*" where I index the following >>> fields >>> >>> >>> >>> >> stored="false" /> >>> >>> and I reuse the index in 3 buckets: "status", "photos" and "videos"... >>> then I do the following: >>> >>> *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', >>> sort='likes_counter desc', rows=10)* >>> >>> This query would give me the top10 most liked items (can be statuses, >>> photos or videos) with at least 100 likes. But how could I limit the >>> resultset to only the "photos" bucket?? The goal is to get the Top10 liked >>> photos without creating an index for itself... as is good to also be able >>> to query the top10 items in general. Any way to do it? >>> >>> In another hand... does somebody know how to do the same query but >>> without the [100 TO *]?? I leave it empty? >>> >>> *results = client.fulltext_search('**posts**', '', sort='likes_counter >>> desc', rows=10)* >>> >>> Thanks, >>> Alex >>> >>> ___ >>> riak-users mailing list >>> riak-users@lists.basho.com >>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >>> >>> >> > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
Oh!! silly me... *_yz_rb* and *_yz_rt*... how didn't I think of that?... thanks also for the "*:*" tip ; ) Thanks! Alex On Fri, May 13, 2016 at 10:50 PM, Vitaly <13vitam...@gmail.com> wrote: > Hi Alex, > > 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to > the photos bucket only. Similarly, "_yz_rt" is for a bucket type. > > Searching for anything in an index can be done with "*:*" (any field, any > value). > > Regards, > Vitaly > > On Fri, May 13, 2016 at 9:40 PM, Alex De la rosa> wrote: > >> Hi all, >> >> Imaging I have an index called "*posts*" where I index the following >> fields >> >> >> >> > /> >> >> and I reuse the index in 3 buckets: "status", "photos" and "videos"... >> then I do the following: >> >> *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', >> sort='likes_counter desc', rows=10)* >> >> This query would give me the top10 most liked items (can be statuses, >> photos or videos) with at least 100 likes. But how could I limit the >> resultset to only the "photos" bucket?? The goal is to get the Top10 liked >> photos without creating an index for itself... as is good to also be able >> to query the top10 items in general. Any way to do it? >> >> In another hand... does somebody know how to do the same query but >> without the [100 TO *]?? I leave it empty? >> >> *results = client.fulltext_search('**posts**', '', sort='likes_counter >> desc', rows=10)* >> >> Thanks, >> Alex >> >> ___ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> >> > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Riak search on an index limited to only 1 bucket
Hi Alex, 'likes_counter:[100 TO *] AND _yz_rb:photos' will limit query results to the photos bucket only. Similarly, "_yz_rt" is for a bucket type. Searching for anything in an index can be done with "*:*" (any field, any value). Regards, Vitaly On Fri, May 13, 2016 at 9:40 PM, Alex De la rosawrote: > Hi all, > > Imaging I have an index called "*posts*" where I index the following > fields > > > > /> > > and I reuse the index in 3 buckets: "status", "photos" and "videos"... > then I do the following: > > *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', > sort='likes_counter desc', rows=10)* > > This query would give me the top10 most liked items (can be statuses, > photos or videos) with at least 100 likes. But how could I limit the > resultset to only the "photos" bucket?? The goal is to get the Top10 liked > photos without creating an index for itself... as is good to also be able > to query the top10 items in general. Any way to do it? > > In another hand... does somebody know how to do the same query but without > the [100 TO *]?? I leave it empty? > > *results = client.fulltext_search('**posts**', '', sort='likes_counter > desc', rows=10)* > > Thanks, > Alex > > ___ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > > ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Riak search on an index limited to only 1 bucket
Hi all, Imaging I have an index called "*posts*" where I index the following fields and I reuse the index in 3 buckets: "status", "photos" and "videos"... then I do the following: *results = client.fulltext_search('posts', 'likes_counter:[100 TO *]', sort='likes_counter desc', rows=10)* This query would give me the top10 most liked items (can be statuses, photos or videos) with at least 100 likes. But how could I limit the resultset to only the "photos" bucket?? The goal is to get the Top10 liked photos without creating an index for itself... as is good to also be able to query the top10 items in general. Any way to do it? In another hand... does somebody know how to do the same query but without the [100 TO *]?? I leave it empty? *results = client.fulltext_search('**posts**', '', sort='likes_counter desc', rows=10)* Thanks, Alex ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com