<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<base href="http://tracker.crosswire.org">
<title>Message Title</title>
</head>
<body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429">
<table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt" bgcolor="#f5f5f5">
<!-- header here -->
<tbody>
<tr>
<td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px">
<table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="cid:jira-generated-image-avatar-3fd97d76-1961-441e-bc7c-9bf6ea636762" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td>
<td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="lafricain" id="email_lafricain" href="http://tracker.crosswire.org/secure/ViewProfile.jspa?name=lafricain" style="color:#000000;; color: #3b73af; text-decoration: none">Cyrille</a> <strong>created</strong> an issue </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px">
<table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate">
<tbody>
<tr>
<!-- there needs to be content in the cell for it to render in some clients -->
<td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff"> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff">
<table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<td class="page-title-pattern-first-line " style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="http://tracker.crosswire.org/browse/API" style="color: #3b73af; text-decoration: none">SWORD</a> / <a href="http://tracker.crosswire.org/browse/API-262" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-5658d2c4-f917-42b1-a649-3fd2753723ac" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom"></a> <a href="http://tracker.crosswire.org/browse/API-262" style="color: #3b73af; text-decoration: none">API-262</a> </td>
</tr>
<tr>
<td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="http://tracker.crosswire.org/browse/API-262" style="color: #3b73af; text-decoration: none">Some searchs fail</a> </span> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand wrapper-special-margin" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 10px; padding-bottom: 5px" bgcolor="#ffffff">
<table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Issue Type:</th>
<td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-avatar-5658d2c4-f917-42b1-a649-3fd2753723ac" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom"> Bug </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Assignee:</th>
<td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> Unassigned </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Attachments:</th>
<td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> swmodule_search_fixes.patch </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Created:</th>
<td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> 07/Mar/26 2:54 PM </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Fix Versions:</th>
<td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> 1.9.0 </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Priority:</th>
<td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-static-major-2b21c213-90a3-428f-8530-345590aebc57" height="16" width="16" border="0" align="absmiddle" alt="Major" style="vertical-align: text-bottom"> Major </td>
</tr>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Reporter:</th>
<td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="lafricain" id="email_lafricain" href="http://tracker.crosswire.org/secure/ViewProfile.jspa?name=lafricain" style="color:#000000;; color: #3b73af; text-decoration: none">Cyrille</a> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand issue-description-container" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 5px; padding-bottom: 10px" bgcolor="#ffffff">
<table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px">
<tbody>
<tr>
<td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0; margin-top: 0"><a href="https://crosswire.org/pipermail/sword-devel/2026-January/050930.html" class="external-link" rel="nofollow" style="color: #3b73af; text-decoration: none">https://crosswire.org/pipermail/sword-devel/2026-January/050930.html</a><br> <a href="https://github.com/crosswire/xiphos/issues/1262" class="external-link" rel="nofollow" style="color: #3b73af; text-decoration: none">https://github.com/crosswire/xiphos/issues/1262</a></p> <h1 style="margin: 10px 0 0 0; font-size: 24px; font-weight: normal; line-height: 1.250; margin: 40px 0 0 0"><a name="Bug1%E2%80%94CLucene%3Asingle%60TERM%60searchreturnsnoresults%28trailingspaceworkaround%29" style="color: #3b73af; text-decoration: none"></a>Bug 1 — CLucene: single `+TERM` search returns no results (trailing space workaround)</h1> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0; margin-top: 10px"><a name="Description" style="color: #3b73af; text-decoration: none"></a>Description</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">When performing a Lucene indexed search (`searchType == -4`) with a single term<br> preceded by `+` (standard Lucene AND syntax), the search returns no results for<br> certain words. Adding a trailing space to the search string resolves the issue.</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Stepstoreproduce" style="color: #3b73af; text-decoration: none"></a>Steps to reproduce</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">```<br> diatheke -b NET -s lucene -k +prophetess<br> → none (NET)</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">diatheke -b NET -s lucene -k '+prophetess '<br> → 8 matches (NET)<br> ```</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Not all words are affected. Words like "Jesus" work regardless, but a subset of<br> words consistently fail with `+TERM` and succeed with `+TERM ` (trailing space).</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Impact" style="color: #3b73af; text-decoration: none"></a>Impact</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Xiphos sidebar search prefixes each term with `+` to perform an implicit AND<br> search. With a single term, this produces `+TERM` which silently fails for<br> affected words. Xiphos has applied a workaround (adding a trailing space before<br> calling SWORD), but the root cause is in SWORD's CLucene integration.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">This also affects Greek LXX word searches (see Bug 2).</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Rootcause" style="color: #3b73af; text-decoration: none"></a>Root cause</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">The CLucene `StandardAnalyzer` tokenizer does not finalize the last token<br> correctly when the input string ends without trailing whitespace. The token is<br> effectively dropped during query parsing.</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Fix" style="color: #3b73af; text-decoration: none"></a>Fix</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">In `SWModule::search()`, append a trailing space to the search string before<br> passing it to `QueryParser::parse()` in the CLucene code path:</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">{{cpp<br> // Append a trailing space to work around a CLucene tokenizer bug where<br> // the last token is not finalized correctly without a following whitespace.<br> // This fixes: single +TERM searches, and some Unicode words (e.g. Greek LXX).<br> SWBuf istrFixed = istr;<br> istrFixed.append(' ');<br> q = QueryParser::parse((wchar_t *)utf8ToWChar(istrFixed.c_str()).getRawData(), _T("content"), &analyzer);}}</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="NoteonXiphosworkaround" style="color: #3b73af; text-decoration: none"></a>Note on Xiphos workaround</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Once this fix is integrated into SWORD, Xiphos may remove its own trailing-space<br> workaround (issue #1262). The two trailing spaces that would result in the<br> interim (SWORD fix + Xiphos workaround both active) are harmless as CLucene<br> ignores multiple trailing spaces.</p> <h1 style="margin: 10px 0 0 0; font-size: 24px; font-weight: normal; line-height: 1.250; margin: 40px 0 0 0"><a name="Bug3%E2%80%94Phraseandmultiwordsearch%3AFrenchtypographicapostrophenotmatched" style="color: #3b73af; text-decoration: none"></a>Bug 3 — Phrase and multi-word search: French typographic apostrophe not matched</h1> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0; margin-top: 10px"><a name="Description" style="color: #3b73af; text-decoration: none"></a>Description</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">French Bible modules use the typographic apostrophe `'` (U+2019, UTF-8:<br> `0xE2 0x80 0x99`) in their text, for example in words like `l'Éternel` or<br> `n'est`. Users typing on a standard keyboard produce the straight apostrophe<br> `'` (U+0027). As a result, searches for French words containing apostrophes<br> return no results.</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Stepstoreproduce" style="color: #3b73af; text-decoration: none"></a>Steps to reproduce</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">In a French Bible module (e.g. LSG), search for:<br> ```<br> l'Éternel → no results (straight apostrophe from keyboard)<br> l'Éternel → results found (typographic apostrophe copy-pasted from text)<br> ```</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Affectedsearchtypes" style="color: #3b73af; text-decoration: none"></a>Affected search types</h2>
<ul class="alternate" type="square">
<li>`searchType == -1` (phrase search)</li>
<li>`searchType == -2` (multi-word search)</li>
</ul> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Lucene indexed search (`searchType == -4`) is not affected as CLucene handles<br> normalization internally during indexing.</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Fix" style="color: #3b73af; text-decoration: none"></a>Fix</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Three changes in `SWModule::search()`:</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"><b>1. Normalize the search term at entry (covers all non-regex search types):</b></p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">```cpp<br> SWBuf term = istr;<br> // Normalize typographic apostrophe (U+2019, UTF-8: 0xE2 0x80 0x99) to standard apostrophe<br> // so that French searches work regardless of which apostrophe the user types<br> {<br> std::string normalizedTerm = term.c_str();<br> size_t pos = 0;<br> while ((pos = normalizedTerm.find("\xe2\x80\x99", pos)) != std::string::npos) </p> { normalizedTerm.replace(pos, 3, "'"); pos += 1; } <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"> term = normalizedTerm.c_str();<br> }<br> ```</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"><b>2. Normalize verse text in `case -1` (phrase search):</b></p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">```cpp<br> textBuf = stripText();<br> // Normalize typographic apostrophe (U+2019) in verse text to match normalized search term<br> {<br> std::string normalizedBuf = textBuf.c_str();<br> size_t pos = 0;<br> while ((pos = normalizedBuf.find("\xe2\x80\x99", pos)) != std::string::npos) </p> { normalizedBuf.replace(pos, 3, "'"); pos += 1; }<br> textBuf = normalizedBuf.c_str();<br> }<br> ```<br> <br> <b>3. Normalize verse text in `case -2` (multi-word search):</b><br> <br> ```cpp<br> textBuf = getRawEntry();<br> // Normalize typographic apostrophe (U+2019) in verse text to match normalized search term<br> {<br> std::string normalizedBuf = textBuf.c_str();<br> size_t pos = 0;<br> while ((pos = normalizedBuf.find("\xe2\x80\x99", pos)) != std::string::npos) { normalizedBuf.replace(pos, 3, "'"); pos += 1; } <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"> textBuf = normalizedBuf.c_str();<br> }<br> ```</p> <h2 style="margin: 10px 0 0 0; font-size: 20px; font-weight: normal; line-height: 1.500; margin: 40px 0 0 0"><a name="Designdecision" style="color: #3b73af; text-decoration: none"></a>Design decision</h2> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Only the right typographic apostrophe (U+2019) is normalized. The left<br> typographic apostrophe (U+2018) and backtick (U+0060) are intentionally excluded<br> as they do not appear in French Bible text.</p> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff">
<table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px">
<tbody>
<tr>
<td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0">
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="http://tracker.crosswire.org/browse/API-262#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-4278ce98-e1fa-49e5-ad02-d43bb931956b" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td>
<td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="http://tracker.crosswire.org/browse/API-262#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table> </td>
</tr>
<!-- there needs to be content in the cell for it to render in some clients -->
<tr>
<td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff"> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px">
<table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian JIRA <span id="footer-build-information">(v7.7.0#77001-<span title="3be31511dfd860a9aedae108fbd5f079b4968c6a" data-commit-id="3be31511dfd860a9aedae108fbd5f079b4968c6a}">sha1:3be3151</span>)</span> </td>
<td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top">
<table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt">
<tbody>
<tr>
<td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-33f46f84-0998-47f2-8705-4f6c2c5763a5" alt="Atlassian logo" title="Atlassian logo" width="169" height="36" class="image_fix"> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table>
</body>
</html>