Skip to content

Fix #96 - Don't escape the ES operator characters that archive.org rejects#97

Merged
jbuckner merged 1 commit into
mainfrom
fix-es-operator-escaping
Jul 20, 2026
Merged

Fix #96 - Don't escape the ES operator characters that archive.org rejects#97
jbuckner merged 1 commit into
mainfrom
fix-es-operator-escaping

Conversation

@jbuckner

Copy link
Copy Markdown
Owner

Fixes #96.

#70 backslash-escaped the full Lucene special set in non-exactMatch values, but archive.org's Elasticsearch backend errors on the escaped operators (\-, \+, \&, \|, \"). - is in nearly every etree recording identifier, so identifier:(gd77\-05\-08...) fails while the unescaped form works.

Drops + - & | " from the escape set (they don't need escaping mid-value on archive.org anyway). Keeps escaping the parser characters #70 needed (( ) { } [ ] ^ ~ : \ / !), which ES accepts escaped.

Verified live against advancedsearch.php: \- \+ \& \| \"BACKEND_ERROR; \[ \( \: etc → fine; unescaped - → works.

All query/escaping tests pass. (The two live-network scrapeTotal integration tests fail against archive.org's currently-flaky scrape backend on main too — unrelated.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cf7er8mrabacGCMtLjd6mQ

…jects

#70 backslash-escaped the full Lucene special set in non-exactMatch values, but
archive.org's Elasticsearch backend returns a backend error for the escaped
operators (`\-`, `\+`, `\&`, `\|`, `\"`). `-` is in nearly every etree recording
identifier, so `identifier:(gd77\-05\-08...)` fails while the unescaped form
works.

Drop `+ - & | "` from the escape set (they don't need escaping mid-value on
archive.org anyway). Keep escaping the parser characters #70 needed
(`( ) { } [ ] ^ ~ : \ / !`), which ES accepts escaped. Verified live against
advancedsearch.php.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cf7er8mrabacGCMtLjd6mQ
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.55%. Comparing base (b7fcf72) to head (6e8d85d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #97   +/-   ##
=======================================
  Coverage   92.55%   92.55%           
=======================================
  Files          13       13           
  Lines         672      672           
=======================================
  Hits          622      622           
  Misses         50       50           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbuckner
jbuckner merged commit 3e180b7 into main Jul 20, 2026
7 checks passed
@jbuckner
jbuckner deleted the fix-es-operator-escaping branch July 20, 2026 19:44
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.

Don't escape the Elasticsearch operator characters (+ - & | ") — archive.org rejects them

1 participant