Here's some more examples / writeups on indexing custom metadata fields, in
addition to Zeeshan's links:

https://github.com/basho/yokozuna/issues/5
https://github.com/basho/yokozuna/blob/develop/docs/TAGGING.md

On Wed, Aug 12, 2015 at 12:25 AM, Zeeshan Lakhani <zlakh...@basho.com>
wrote:

> Hey Joe,
>
> Yes, you are able to index with meta/tag fields. Here’s an example in one
> of our erlang tests using the riak_erlang pb client:
> https://github.com/basho/yokozuna/blob/32d71135644a579943799ff9a70b67dee0201f80/riak_test/yokozuna_essential.erl#L306
> .
>
> `user_s` is indexed, for example, b/c of
> https://github.com/basho/yokozuna/blob/develop/priv/default_schema.xml#L36 in
> the default schema.
>
> Hope this helps. Thanks.
>
>
> Zeeshan Lakhani
> programmer |
> software engineer at @basho |
> org. member/founder of @papers_we_love | paperswelove.org
> twitter => @zeeshanlakhani
>
> On Aug 11, 2015, at 5:34 PM, Joe Olson <technol...@nododos.com> wrote:
>
>
> Is it possible to automatically index custom X-Riak-Meta-* fields with
> Solr? Do I have to create a custom extractor or modify the default search
> schema as outlined at
> http://docs.basho.com/riak/latest/dev/search/custom-extractors/ ?
>
> Here is my python code I am using to test:
>
> # Create search index
> client = RiakClient(protocol='pbc',nodes=[{ 'host': 'xxx.yyy.zzz.www',
> 'pb_port': 8087 }])
> client.create_search_index('testindex1', '_yz_default')
>
> # On cluster: create bucket type, assign index
> # riak-admin bucket-type create solrindexed
> '{"props":{"search_index":"testindex1"}}'
> # riak-admin bucket-type activate solrindexed
>
> # Create instance of bucket using bucket type
> bucket = client.bucket_type('solrindexed').bucket('myBucket')
>
> # Create new key in bucket
> obj = RiakObject(client, bucket, 'myKey')
>
> # Create metadata in headers, integers not allowed here???
> obj.usermeta = {"startTime":"1443506400000", "endTime":"1443507000000"}
>
> # Jam some random bytes in there
> obj.encoded_data = open("/dev/urandom","rb").read(int(1258291))
> obj.content_type = 'application/octet-stream'
>
> # Write it
> obj.store()
>
> # Now see if we can find it..what is the syntax here? Always returns
> 'num_found': 0
> results = client.fulltext_search('testindex1',
> 'X-Riak-Meta-startTime:1443506400000')
> print results
>
> Also, according to the documentation at
> http://basho.github.io/riak-python-client/object.html, 'usermeta' can
> only have strings on the value side. Is there an explanation why integers
> aren't allowed?
>
> _______________________________________________
> 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

Reply via email to