Comments (10)
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.
👍 shame this isn't in already, a basic piece of functionality IMO.
from pysolr.
@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.
As alternative, you can change back to "old" SOLR behavior:
- 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 - rename your current
/select
request handler and add the attributedefault="true"
- 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.
@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.
@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.
@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.
from pysolr.
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.
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)
- delete() is not escaping special XML characters in its query or ID parameters. HOT 5
- Solr responded with an error (HTTP 400): [Reason: Error parsing JSON field value. Unexpected OBJECT_START at [##], field=??] HOT 1
- Support for customized Python installs which do not include setuptools HOT 6
- Add "add if not exists" functionality to pysolr HOT 1
- Error when deleting documents HOT 2
- Is there a new release for pysolr? HOT 11
- q.op doesn't work in solr.search()
- `solr.ping()` returns 404: `SolrError: Solr responded with an error (HTTP 404): [Reason: Error 404 Not Found]` HOT 7
- Installing 3.9.0 release via pip is somehow broken HOT 2
- Unknown operation for the an atomic update with pysolr-3.9.0 HOT 2
- Intermittent Connection Failure
- Unable to store custom/nested JSON docs
- How can I export (/export)?
- "Required" should be remove from Travis CI HOT 1
- Code Injection HOT 3
- Unable to retrieve results using pysolr.search() with grouping HOT 2
- AttributeError: 'int' object has no attribute 'decode' HOT 1
- commitWithin for Solr.add is ignored when JSON update API is used (when no `boost` or `fieldUpdates`) HOT 1
- DeprecationWarning from pkg_resources on Python 3.10+ HOT 2
- NaN values are not working when simplejson >= 3.19.0 is used
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysolr.