pysolr
pysolr copied to clipboard
add() should accept empty list
I have
- [x] Tested with the latest release
- [x] Tested with the current master branch
- [x] Searched for similar existing issues
Expected behaviour
solr_client.add([{'id': 'myid', 'multivalued_field_to_overwrite': ['value1'], 'multivalued_field_to_flush': []}], fieldUpdates={'multivalued_field_to_overwrite': 'set', 'multivalued_field_to_flush': 'set'})
should remove all the values of multivalued_field_to_flush
.
Actual behaviour
multivalued_field_to_flush
values are intact.
Steps to reproduce the behaviour
In [8]: solr_client.add([{'id': 'myid', 'multivalued_field_to_overwrite': ['value1'], 'multivalued_field_to_flush': []}], fieldUpdates={'multivalued_field_to_overwrite': 'set', 'multivalued_field_to_flush': 'set'})
Then Solr._build_doc()
generates the HTML body like: <add><doc><field name="id">myid</field><field name="multivalued_field_to_overwrite">value1</field></doc></add>
.
This body message should also include <field name="multivalued_field_to_flush"></field>
to properly remove the values.
Configuration
- Operating system version: Ubuntu 19.04
- Search engine version: Solr 7.7.1
- Python version: 3.7.3
- pysolr version: 3.8.1
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.
This problem is also happening to us.
It is always strange to see bots close issues based on inactivity. Just because no one has fixed the issue doesn't mean that the issue is gone.
@bluenote10 I agree, but we get a ton of issues which are due to local configuration or installation mistakes, misunderstandings, etc. and most of those never get updated by the original reporter. You can re-open an issue at any time if it's still relevant and you're planning to work on it.