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
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com