lugensa / scorched

Sunburnt offspring solr client
MIT License
27 stars 19 forks source link

Default mode should be read only #43

Open mlissner opened 7 years ago

mlissner commented 7 years ago

This is a small thing that I just discovered while looking at the code, but if you don't supply a mode parameter to your SolrInterface, you get a read/write interface by default. The code in the __init__ method is:

    if mode == 'r':
        self.writeable = False
    elif mode == 'w':
        self.readable = False

This is a design question, but I think this would be better if the default was read only. This would require people to create writable interfaces explicitly, which seems important.

This is a breaking API change, so we'll want to consider it carefully, but it seems like a good direction to me.