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

Request handler #134

Merged
merged 3 commits into from
Apr 27, 2016
Merged

Request handler #134

merged 3 commits into from
Apr 27, 2016

Conversation

nuarhu
Copy link
Contributor

@nuarhu nuarhu commented Oct 21, 2014

This is a pull request that contains and replaces #112 , addressing #51 and #52 :

Additionally to specifying request handlers at the method level, it allows to specify a search_handler as instance variable. Also, a new instance variable use_qt_param is available that allows to change how request handlers are specified in the SOLR URL. The default SOLR behavior is to expect the handler as URL path variable (current #112 implementation). The pre 3.6 default behavior (and still available via configuration) specifies the request handler via qt parameter in the URL.

This pull request will allow to specify a custom request handler at construction time and thus allow to configure it as data source for Haystack like this:

HAYSTACK_CONNECTIONS = {
    'default': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://127.0.0.1:8983/solr/core0'
    },
    'autocomplete': {
        'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
        'URL': 'http://127.0.0.1:8983/solr/core0',
        'KWARGS': {
            'search_handler': '/autocomplete',
            #'use_qt_param': False,  # False by default
        }
    },
}

Update README to include documentation of custom handlers.

I had to change the import statement in get-solr-download-url.py to make the tests run. (Using 3.4 but actually my fix should be for python3 in general.)

@nuarhu
Copy link
Contributor Author

nuarhu commented Jul 21, 2015

I've rebased this onto toastdriven/master.

@nuarhu
Copy link
Contributor Author

nuarhu commented Feb 29, 2016

Rebased onto current master.

nuarhu pushed a commit to itagenten/pysolr that referenced this pull request Feb 29, 2016
@nuarhu
Copy link
Contributor Author

nuarhu commented Feb 29, 2016

The following test run fails:

Python 3.3.; SOLRCLOUD=False

During all of the tests in this run, no connection can be established to SOLR. This works in all the other test runs. It might be a one time thing?

Failed to establish a new connection: [Errno 111] Connection refused

I assume this means that my tests are fine, all over, seeing that all of the other runs finish just fine.

@acdha
Copy link
Collaborator

acdha commented Feb 29, 2016

@nuarhu After restarting that build, it passed – we definitely see sporadic failures caused by how long it can take Solr to startup. I actually just made 05f0674 to reduce that, although it wouldn't have helped with this particular problem.

@nuarhu
Copy link
Contributor Author

nuarhu commented Mar 1, 2016

@acdha Thanks for checking! I hope everything is fine with my rebase and you are fine merging it.

Chantal Ackermann added 3 commits April 27, 2016 16:22
…ack#112 : allow specifying query_handler (SOLR request handler, qt) during initialization. Added flag to allow specifying request handlers via qt parameter.
…ack#112 : changed kwarg from query_handler to search_handler. Added tests for use_qt_param True/False.
@nuarhu
Copy link
Contributor Author

nuarhu commented Apr 27, 2016

rebased - again! Please consider merging this?

@acdha acdha merged commit 41bf7ec into django-haystack:master Apr 27, 2016
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

Successfully merging this pull request may close these issues.

2 participants