Code Monkey home page Code Monkey logo

Comments (10)

llnik avatar llnik commented on August 19, 2024

Please see my fork for a patch (sorry, new to github - don't know how to open a pull request) llnik/pysolr@e65143b

With this, a custom handler "search" could be used like this

import pysolr
s = pysolr.Solr("localhost:8983/solr")
foo = s.search(q="bar", handler="search") # queries /solr/search instead of /solr/select
baz = s.search(q="bar").docs # queries /solr/select (default behaviour)

/Edit: [x] Pull request

from pysolr.

hamishcampbell avatar hamishcampbell commented on August 19, 2024

👍 shame this isn't in already, a basic piece of functionality IMO.

from pysolr.

acdha avatar acdha commented on August 19, 2024

@hamishcampbell If you have time to help to work on a pull-request, I think #52 might be a good starting point. If we can get a current patch and some tests it'll be a lot faster to merge

from pysolr.

nuarhu avatar nuarhu commented on August 19, 2024

As alternative, you can change back to "old" SOLR behavior:

  1. Set the RequestDispatcher to handleSelect="true" (default is false since 3.6).
    See https://wiki.apache.org/solr/SolrRequestHandler#Old_handleSelect.3Dtrue_Resolution_.28qt_param.29
  2. rename your current /select request handler and add the attribute default="true"
  3. add the qt parameter to your queries: qt=/myhandler (you can leave the slashes but the request handlers won't be accessible via path variable). The value of the qt variable is exactly the value of the name attribute.

Example solrconfig.xml (extract):

<requestDispatcher handleSelect="true" >
    <!-- Make sure your system has some authentication! before using enableRemoteStreaming="true" -->
    <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />

    <httpCaching lastModifiedFrom="openTime" etagSeed="Solr" />
    <httpCaching never304="true"/>
</requestDispatcher>

<requestHandler name="/myhandler" class="solr.SearchHandler" default="true">
    <lst name="defaults">
        <str name="defType">edismax</str>
        <str name="echoParams">explicit</str>
        <str name="q.op">AND</str>
        ...
    </lst>
</requestHandler>

from pysolr.

mbeacom avatar mbeacom commented on August 19, 2024

@toastdriven @acdha Are you still actively merging pull requests? Can we please get some of these patches merged in or explanation as to why they were rejected? Thank you!

from pysolr.

acdha avatar acdha commented on August 19, 2024

@mbeacom If you need either of these, the first place to start would be updating the code against the current branch to confirm that there are no test regressions. I work on pysolr in my spare time so anything which makes review easier is going to help.

from pysolr.

mbeacom avatar mbeacom commented on August 19, 2024

@acdha I am not trying to add more work for you. I'll go ahead and get it up to speed. Thank you!

from pysolr.

mbeacom avatar mbeacom commented on August 19, 2024

@acdha #161

from pysolr.

nuarhu avatar nuarhu commented on August 19, 2024

I've rebased (again) onto the current master (pull request #134). Is there a problem or are there considerations that prevent you from merging this? We are using this in production without issues, so far.

from pysolr.

stale avatar stale commented on August 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from pysolr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.