Skip to content

Xapian2 support#240

Merged
claudep merged 4 commits into
notanumber:masterfrom
ojwb:xapian2-support
Apr 3, 2026
Merged

Xapian2 support#240
claudep merged 4 commits into
notanumber:masterfrom
ojwb:xapian2-support

Conversation

@ojwb

@ojwb ojwb commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

The existing CI on master seems to have bitrotted and fails if re-run now without changing the repo contents at all. I've fixed some of the problems, but I don't understand why one of the 3.8 builds fails, nor why all the 3.10 builds fail, so I've just excluded those. See individual commit messages for details of the errors I ran into. As I said in #239, I don't develop (or even use) django, haystack or xapian-haystack, and I do very little Python, so I think I'm the wrong person for the job of trying to fix these excluded builds.

The key changes which are actually updating the code for Xapian 2 are in 2bebec9:

    Eliminate use of xapian.ValueRangeProcessor
    
    This class was deprecated in Xapian 1.4 and removed in Xapian 2.
    Instead use xapian.RangeProcessor or construct Query objects directly.
    
    This makes xapian-haystack compatible with Xapian 2.  Fixes #239.
    
    Open-ended ranges now build open-ended Xapian range queries, addressing
    two TODO comments.
    
    A range query on an unknown field is now handle gracefully.  Fixes #236.
    
    A range query of type int or float with an open upper end no longer
    requires `*` for the upper end.  Fixes #217.

The Xapian 1.5.1 version used in CI is a release candidate for 2.0.0 so that should be adjusted to use 2.0.0 once actually released.

@coveralls

coveralls commented Mar 15, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.376% (-0.2%) from 97.588%
when pulling 690f45f on ojwb:xapian2-support
into 5eec1ff on notanumber:master.

@ojwb

ojwb commented Mar 17, 2026

Copy link
Copy Markdown
Contributor Author

The Xapian 1.5.1 version used in CI is a release candidate for 2.0.0 so that should be adjusted to use 2.0.0 once actually released.

2.0.0 is now released so I've pushed an update to test with it.

@claudep

claudep commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

Hi Olly, I just pushed a separate PR where we fixed the test suite and upgraded to recent Pthon/Django versions. May I ask you to rebase your PR on latest master? You should be now able to concentrate to xapian 2 compat only. Sorry for not doing that sooner.

ojwb added 2 commits March 19, 2026 08:47
This class was deprecated in Xapian 1.4 and removed in Xapian 2.
Instead use xapian.RangeProcessor or construct Query objects directly.

This makes xapian-haystack compatible with Xapian 2.  Fixes notanumber#239.

Open-ended ranges now build open-ended Xapian range queries, addressing
two TODO comments.

A range query on an unknown field is now handle gracefully.  Fixes notanumber#236.

A range query of type int or float with an open upper end no longer
requires `*` for the upper end.  Fixes notanumber#217.
Odd minor no longer means a development version with suffixed tools,
and we require Xapian 1.4+ so 1.3.x is no longer relevant.
@ojwb
ojwb force-pushed the xapian2-support branch from 770c188 to 03e82e2 Compare March 18, 2026 19:52
ojwb added 2 commits March 19, 2026 09:10
This was breaking tests with 2.0.0 (because only the minor version was
tested), but is no longer useful since Xapian 1.4+ is required.
@ojwb
ojwb force-pushed the xapian2-support branch from 03e82e2 to 690f45f Compare March 18, 2026 20:10
@asedeno

asedeno commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

The decrease in coverage technically correct, but a false positive. It comes from dropping the special case for odd minor versions, which reduced the line count by two and the covered line count by one.

@claudep

claudep commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

@asedeno Does your comment implies you are approving this PR?

@asedeno

asedeno commented Mar 18, 2026

Copy link
Copy Markdown
Collaborator

I have not reviewed the changes in detail, but the wheels build and the tests pass, which satisfies me as a former xapian-haystack user. Note that I am no longer at the job where I was using this, so I haven't actually used this in years.

@asedeno

asedeno commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

@asedeno Does your comment implies you are approving this PR?

@claudep I've looked over this some more. Yes, we should merge this.

@claudep

claudep commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

@ojwb, as we will probably make a release soon after merging this patch, it would be great to have some content for the Changelog related to these changes. Would you agree to suggest something?

@ojwb

ojwb commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

I already summarised the changes in the first comment:

    Eliminate use of xapian.ValueRangeProcessor
    
    This class was deprecated in Xapian 1.4 and removed in Xapian 2.
    Instead use xapian.RangeProcessor or construct Query objects directly.
    
    This makes xapian-haystack compatible with Xapian 2.  Fixes #239.
    
    Open-ended ranges now build open-ended Xapian range queries, addressing
    two TODO comments.
    
    A range query on an unknown field is now handle gracefully.  Fixes #236.
    
    A range query of type int or float with an open upper end no longer
    requires `*` for the upper end.  Fixes #217.

@claudep
claudep merged commit 6931d84 into notanumber:master Apr 3, 2026
36 of 46 checks passed
@ojwb
ojwb deleted the xapian2-support branch April 4, 2026 20:26
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.

4 participants