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

More flexible sort in queries #11

Closed
GoogleCodeExporter opened this issue Mar 13, 2015 · 6 comments
Closed

More flexible sort in queries #11

GoogleCodeExporter opened this issue Mar 13, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

solr_conn = solr.SolrConnection('http://localhost:8080/solr')

solr_conn.query('test query', sort='field1 asc, field2 desc')

This doesn't work. I get a "400 Bad Request" response.

According to the docstrings, the sort param could be a string in the format
that SOLR expects, or a python list/tuple of field names.

I've attached a diff with a proposed fix for this.


Original issue reported on code.google.com by augusto%...@gtempaccount.com on 26 May 2009 at 8:35

Attachments:

@GoogleCodeExporter
Copy link
Author

I've attached a new diff including the fix for the paginator.

Original comment by augusto%...@gtempaccount.com on 26 May 2009 at 9:35

Attachments:

@GoogleCodeExporter
Copy link
Author

I did encounter the same problem, however I came up with a slightly different 
solution 
that should preserve backwards compatibility (or, atleast, makes all tests 
pass).

Original comment by shywolf9...@gmail.com on 4 Feb 2010 at 9:54

Attachments:

@GoogleCodeExporter
Copy link
Author

Hmm, so it looks like we've got two potential patches to choose from. Can you 
both 
perhaps work together on a common approach, and add a unittest for the new 
functionality? Perhaps it would help if you both could work off of trunk w/ svn 
commit 
bits?

Original comment by ed.summers on 4 Feb 2010 at 11:43

@GoogleCodeExporter
Copy link
Author

Well, my approach does not differ greatly. It does not break backwards 
compatibility 
(which I think is very needed) although it lacks the paginator fix, which 
should be 
definitely incorporated, along with unit tests.

So yes, I am available to work with whoever is interested or by submitting 
another 
"mixed" patch (meaning with a reasonable mix of the two approaches plus unit 
tests) 
against trunk.

Original comment by shywolf9...@gmail.com on 4 Feb 2010 at 11:59

@GoogleCodeExporter
Copy link
Author

Attached a patch against trunk, revision 52 (most recent rev at time of 
writing) that 
incorporates the best of both approaches and adds a test.

Original comment by shywolf9...@gmail.com on 6 Feb 2010 at 4:42

Attachments:

@GoogleCodeExporter
Copy link
Author

Fixed in r53

Original comment by ed.summers on 7 Feb 2010 at 9:13

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant