Comments (19)
@mlissner I'm marking this a 4.0.0 since it seems like the kind of thing we should feature prominently in the release notes.
from pysolr.
@efagerberg That seems reasonable if you want to send a pull request - change the default and document how to change it back should you depend on it in some way.
from pysolr.
Before I make that change to the PR I want to make sure the maintainer is ok with that. @acdha do you have any thoughts?
from pysolr.
I should have put that in the message — it's 30 days after the message to confirm that an issue is still relevant:
https://github.com/django-haystack/pysolr/blob/master/.github/stale.yml#L4
It seems like between this, #94, etc. it might be worth rolling a 4.0 release with a few of these breaking cleanups.
from pysolr.
Sorry, this is probably a wontfix as it is very backward-incompatible. Most usage I've seen sends a fair number of docs (500-1000 docs) at a time, so the default "autocommit" makes a lot of sense. The commit=...
kwarg is there on every data manipulation method, so you still have the option not to do it.
from pysolr.
I understand. I think the least you could do is make the documentation exceptionally clear when PySolr will send a commit automatically.
from pysolr.
Agreed on that. Reopening as a docs ticket.
from pysolr.
I'd like to revisit this conversation and get commit=False
put on the roadmap for the next big version of pysolr.
Here's my argument:
- This isn't documented, even though it should have been four years ago.
- At some point this change should be made.
- Coming from other libraries, every one of them has an
add
method and I've never seencommit=True
prior to this. - If you ever use
add
without remembering to docommit=True
on a big system, you've made a grievous error (this shouldn't be the default).
I recognize that this is a major disruption for people, but I think we should bite the bullet and do it. It's easy to upgrade your code to add commit=True
wherever you have an add
method in the past.
from pysolr.
Fantastic, @acdha. That was my hope!
from pysolr.
@acdha Perhaps a good solution is to somehow make the default commit value be configurable on the PySolr object level or module level. That way we can still support older solr versions.
from pysolr.
PR here: #221
from pysolr.
I gave a thumbs up to this approach earlier, but I'm looking at the now, and I really don't like it. I especially don't like how the add
function has an argument that can be True, False, or None.
Seems like if we're doing a version bump, we should accept some backwards breakage, and I don't think we need to support the way it used to work, if it means we'll forever have a more complex API, more documentation, more tests, etc. I say break with the past, make a note in the release notes, and move forward with the right way.
from pysolr.
@mlissner so the PR I posted does incure some backwards breakage already as you have to explicitly set an option in the Solr
object. I use the presence of commit=None
to signal that the user has not supplied that arg, otherwise it would be impossible to tell if the user explicitly doesn't want to commit something.
I don't think of it solely as supporting the past at this point because it still allows some simplicity in writing the code if you want to commit you do not have to write two lines, you can do it in one.
I am fine with not allowing an option in the constructor to go back to similar functionality, but we would probably want that functionality to specify when to commit in the add
function as syntactic sugar.
from pysolr.
I am fine with not allowing an option in the constructor to go back to similar functionality, but we would probably want that functionality to specify when to commit in the add function as syntactic sugar.
Yeah, that's what I'd suggest too. Basically, add
gets a new option about committing, defaults to not committing, and that's it.
The use case for setting up a SolrInterface, and then wanting every add
to do a commit seems small to me. I think other libraries (FWIW) have commit
as a separate call altogether.
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.
If pysolr still has life, this should most definitely not be closed.
It'd be nice if the stale bot could say how long you had until something was automatically closed.
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.
Hey folks, I have rebased on the master branch so my PR should be up to date, please let me know if there is any other feedback you have to make it an acceptable contribution.
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.