I know this might sound strange, but what if the data was formatted like so:
{"id": 1, stats: [ {"stat1": {"name":"stat1", "group": "x", "value": 1}}, {"stat2": {"name": "stat2", "group": "x", "value": 5}} ] } Would the default extractor flatten this to : stats.stat1.name = stat1, stats.stat1.group = x, stats.stat1.value = 1 stats.stat2.name = stat2, stats.stat2.group = x, stats.stat2.value = 5 As far as indexing is concerned, would this be the same as {"stats": {"stat1": {...}, "stat2": {...}} ? Andrew On Sun, Oct 26, 2014 at 1:46 PM, Andrew Zeneski <and...@andrewzeneski.com> wrote: > That would be ideal I know, but would require a huge effort and is > something I am saving as a last resort. A custom extractor should allow me > to massage the value into a more index friendly format before sending to > Solr but allowing the value to remain in its current form. > > I have no experience with this so I'm not sure the LoE involved in such a > task. Any advice is surely appreciated! Thanks for your input. > > Andrew > > On Sun, Oct 26, 2014 at 10:58 AM, Alexander Sicular <sicul...@gmail.com> > wrote: > >> That might happen. >> >> Could you rearrange your data to look like >> >> Id: ... , stats: { >> Stat1: [ ... ], >> Stat2: [ ... ], >> ... >> >> } >> >> Then you could do a stats_stat1 > 1 query. It's also more space >> efficient. Derived vs explicit naming. Stat(N) could even be an array of >> hashes like [{value:..., dates:...},...] if you needed that. >> >> -Alexander >> >> @siculars >> http://siculars.posthaven.com >> >> Sent from my iRotaryPhone >> >> On Oct 26, 2014, at 10:43, Andrew Zeneski <and...@andrewzeneski.com> >> wrote: >> >> Yes right, I was tired when I typed this; stats should be an array: >> >> {"id": 1, "stats": [{ "name": "stat1", "value": 1 }, {"name": "stat2", >> "value": 5}]} >> {"id": 2, "stats": [{ "name": "stat3", "value": 2 }, {"name": "stat1", >> "value": 3}]} >> {"id": 3, "stats": [{ "name": "stat2", "value": 3 }, {"name": "stat3", >> "value": 1}}] >> >> I haven't tried it either, but I was worried that stats_name = stat1 and >> stats_value > 1 would return both ID 1 and 2 because both have a name >> stats1 and both have some value > 1. >> >> Andrew >> >> >> On Sun, Oct 26, 2014 at 12:50 AM, Alexander Sicular <sicul...@gmail.com> >> wrote: >> >>> Haven't tried it out but should stats be an array? >>> >>> And the query would be something like >>> >>> Stats_name = stat1 and stats_value > 1 >>> >>> I think the extractor flattens everything and separates with underscores. >>> >>> -Alexander >>> >>> @siculars >>> http://siculars.posthaven.com >>> >>> Sent from my iRotaryPhone >>> >>> > On Oct 25, 2014, at 22:53, Andrew Zeneski <and...@andrewzeneski.com> >>> wrote: >>> > >>> > Hi All, I'm trying to determine if a use case is supported by >>> Yokozuna or not. >>> > >>> > With a stored value that looks like: >>> > >>> > {"id": 1, "stats": { "name": "stat1", "value": 1 }, {"name": "stat2", >>> "value": 5}} >>> > {"id": 2, "stats": { "name": "stat3", "value": 2 }, {"name": "stat1", >>> "value": 3}} >>> > {"id": 3, "stats": { "name": "stat2", "value": 3 }, {"name": "stat3", >>> "value": 1}} >>> > >>> > I want to find those who have stat1 > 2. The result should be id 2. >>> > >>> > I believe Solr 4.8 would handle this as a block-join, but I don't >>> think Yokozuna supports this feature. My first thought was a custom >>> extractor; are there other options I'm not seeing? >>> > >>> > Thanks! >>> > >>> > Andrew >>> > _______________________________________________ >>> > 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