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

Support for sending custom parameters to Solr #37

Open
mlissner opened this issue Sep 21, 2016 · 2 comments
Open

Support for sending custom parameters to Solr #37

mlissner opened this issue Sep 21, 2016 · 2 comments

Comments

@mlissner
Copy link
Contributor

I'm not sure if there's an appetite for this, but I find it enormously useful to be able to send arbitrary parameters to Solr outside of what the API typically allows (i.e., low-level queries like what pysolr provides).

I have a function I hacked on top of sunburnt that allows me to do raw queries. For example, I can do this:

self.si.raw_query(**{'q': '*', 'caller': 'update_index'})

And that'll make a Solr request like:

http://localhost:8983/select/?q=*&caller=update_index

The main way I use this is to add a caller parameter to every request I make so that I can keep track of which ones are slow or later sort things out in the logs, but I also use it when sunburnt or lacks a parameter I need.

Any appetite for adding this into core? I can provide a PR if so.

@mlissner
Copy link
Contributor Author

I've continued researching this today and there's some good news. Looks like this was added to Sunburnt towards the end of last year. Would a PR to merge this in be welcome? It's a slim and tidy little patch:

tow/sunburnt#80

Basically, it makes it so you can do:

si.add_extras({'some': 'stuff'})

And it will simply be added to your normal chainable query.

@mlissner
Copy link
Contributor Author

Sorry to keep sending messages today. Here's a gist providing the extended classes, in case other people want to just use them:

https://gist.github.com/mlissner/d1e32a5572932665c15541fdb2e2c7af

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