Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected stored value for multivalued fields in riak search [JIRA: CLIENTS-514] #406

Open
dellsystem opened this issue Jul 7, 2015 · 3 comments

Comments

@dellsystem
Copy link

(Originally posted on the riak-users mailing list; duplicated here by request of @zeeshanlakhani in case it's an issue with the Python client)

Hi all,

I'm having an issue with stored multiValued fields in Riak search not being stored the way I would expect.

If I use the default schema, and store the following JSON document (from the documentation)

{"people_ss": ["Ryan", "Eric", "Brett"]}

and then search with the query "people_ss:Ryan", the document that I get back contains "people_ss": ["Ryan", "Eric", "Brett"], as I would expect.

However, if I instead create the document

{"people_ss": ["Ryan"]}

then searching with the query "people_ss:Ryan" results in a document with "people_ss": "Ryan", where the value associated with "people_ss" is a string, not a list of strings as I would expect.

I couldn't find anything about this in any of the Github issue trackers or the mailing list. Is this a bug, or desired behaviour? Is there a way to ensure that lists with a single element are stored in Solr (and retrieved) as lists, instead of as strings?

I'm using the official Riak Python client with Riak 2.1.1 and search enabled.

Thanks in advance!

@Basho-JIRA Basho-JIRA changed the title Unexpected stored value for multivalued fields in riak search Unexpected stored value for multivalued fields in riak search [JIRA: CLIENTS-514] Jul 7, 2015
@hazen
Copy link

hazen commented Jul 7, 2015

Thanks for reporting this, @dellsystem. I'm looking at issues to address in the next release of the Python client, so I'll put this on my list.

@zeeshanlakhani
Copy link

Adding this comment from @zeeshanlakhani's email:

I was not able to reproduce via http in an example (i.e. groups_s) I tried:

 "response" : {
      "maxScore" : 0.30685282,
      "numFound" : 1,
      "docs" : [
         {
            "_yz_rt" : "multifunarray",
            "_yz_fpn" : "49",
            "groups_s" : [
               "3304cf79"
            ],
            "_yz_rk" : "multivalued_array",
            "_yz_id" : "1*multifunarray*b2*multivalued_array*49",
            "_yz_ed" : "2 49 bXVsdGlmdW5hcnJheQ== YjI= bXVsdGl2YWx1ZWRfYXJyYXk= g2IBnehH",
            "_yz_rb" : "b2",
            "_yz_pn" : "49"
         }
      ],
      "start" : 0

@dellsystem
Copy link
Author

I'd love to take a swing at this myself, but I'm not sure where to start - I looked around the source code but couldn't find the right module. It would be awesome if someone could point me in the right direction.

@lukebakken lukebakken modified the milestone: riak-python-client-2.7.1 Dec 16, 2016
@lukebakken lukebakken modified the milestones: riak-python-client-2.7.1, riak-python-client-3.0.0 Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants