Skip to content

Add Python 3 and modern Solr (7+) compatibility#1

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/update-solr-releases-support
Draft

Add Python 3 and modern Solr (7+) compatibility#1
Copilot wants to merge 5 commits intomasterfrom
copilot/update-solr-releases-support

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 29, 2026

The library was Python 2 only and lacked support for Point field types introduced in Solr 7, preventing use with recent Solr releases.

Changes

Python 3 Compatibility

  • Added compatibility layer for Python 2/3 differences:
    • unicode/basestringtext_type/string_types (as tuples)
    • cStringIOio.StringIO
    • urllib/urlparseurllib.parse
    • base64.encode()base64.b64encode()
    • Exception syntax: except E, e:except E as e:
    • Print statements → functions

Modern Solr Field Types

  • Added support for Point field types (Solr 7+):
    • IntPointField, LongPointField, FloatPointField, DoublePointField, DatePointField
    • Int32PointField, Int64PointField (alternative naming)
  • Maintained backward compatibility with deprecated Trie/Sortable field types

Example

# Schema with modern Point fields now works
schema_xml = '''
<schema name="example" version="1.6">
  <types>
    <fieldType name="int" class="solr.IntPointField"/>
    <fieldType name="long" class="solr.LongPointField"/>
  </types>
  <fields>
    <field name="id" type="string" required="true"/>
    <field name="count" type="int"/>
  </fields>
</schema>
'''
schema = SolrSchema(StringIO(schema_xml))  # Works in Python 3 with Solr 7+ schemas

Backward Compatibility

All existing APIs unchanged. Supports Python 2.7+ and Solr 1.3+.

Original prompt

create a PR to make this work for recent solr releases


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits January 29, 2026 03:00
Co-authored-by: wiswaud <166374+wiswaud@users.noreply.github.com>
… Solr field types

Co-authored-by: wiswaud <166374+wiswaud@users.noreply.github.com>
Co-authored-by: wiswaud <166374+wiswaud@users.noreply.github.com>
…nd imports

Co-authored-by: wiswaud <166374+wiswaud@users.noreply.github.com>
Copilot AI changed the title [WIP] Update project for recent Solr releases compatibility Add Python 3 and modern Solr (7+) compatibility Jan 29, 2026
Copilot AI requested a review from wiswaud January 29, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants