Catch InvalidTokenOffsetsException in QuranTextSearcher.java

2 views
Skip to first unread message

Mehdi Dogguy

unread,
Dec 27, 2009, 4:19:13 PM12/27/09
to zekr...@googlegroups.com

Hello,

I tried to build Zekr using OpenJDK 6 (version 6b16-1.6.1-2) in Debian.
The compilation fails because the exception InvalidTokenOffsetsException
was not catched, nor declared to be thrown.

Please find attached a patch to fix the issue. I did a minimal change
but maybe you want to catch the exception to do something smarter.

Best regards,

--
Mehdi Dogguy مهدي الدڤي
http://dogguy.org/

catch_InvalidTokenOffsetsException.diff

أحمد المحمودي

unread,
Dec 28, 2009, 3:46:48 AM12/28/09
to zekr...@googlegroups.com
السلام عليكم،

On Sun, Dec 27, 2009 at 10:19:13PM +0100, Mehdi Dogguy wrote:
> I tried to build Zekr using OpenJDK 6 (version 6b16-1.6.1-2) in Debian.
> The compilation fails because the exception InvalidTokenOffsetsException
> was not catched, nor declared to be thrown.
>
> Please find attached a patch to fix the issue. I did a minimal change
> but maybe you want to catch the exception to do something smarter.

---end quoted text---

This patch caused build failure on Ubuntu !

--
‎أحمد المحمودي (Ahmed El-Mahmoudy)
Digital design engineer
GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Mehdi Dogguy

unread,
Dec 28, 2009, 4:16:33 AM12/28/09
to zekr...@googlegroups.com
أحمد المحمودي wrote:
>
> This patch caused build failure on Ubuntu !
>

Can you paste the error message so that I understand what happens?

Cheers,

Mohsen Saboorian

unread,
Dec 28, 2009, 4:33:43 AM12/28/09
to zekr...@googlegroups.com
Salaam,

Zekr is not compatible with Lucene > 2.3.x. The exception you mentioned was added in Lucene 2.9.0.

Mohsen

--

You received this message because you are subscribed to the Google Groups "zekr-dev" group.
To post to this group, send email to zekr...@googlegroups.com.
To unsubscribe from this group, send email to zekr-dev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/zekr-dev?hl=en.



Mehdi Dogguy

unread,
Dec 28, 2009, 4:43:48 AM12/28/09
to zekr...@googlegroups.com
Mohsen Saboorian wrote:
> Salaam,
>
> Zekr is not compatible with Lucene > 2.3.x. The exception you mentioned was
> added in Lucene 2.9.0.
>

Well, it seems to work fine with the patch. You'll also face the same
issue in Ubuntu Lucid since it ships liblucene2-java 2.9.1.

Regards,

Mohsen Saboorian

unread,
Dec 28, 2009, 4:50:41 AM12/28/09
to zekr...@googlegroups.com
Since Lucene had a lot of backward-incompatible changes from 2.4 to 2.9, many applications depending on Lucene, do not yet support it yet. I also tested Zekr with this version and it needs some changes in the code. I don't know how did you test it, but for sure Zekr doesn't work with original 2.9.0 package downloaded from apache.org.

Are you able to run Zekr and use advanced search with Lucene 2.9?

Mohsen

Mehdi Dogguy

unread,
Dec 28, 2009, 5:10:38 AM12/28/09
to zekr...@googlegroups.com
Mohsen Saboorian wrote:
> Since Lucene had a lot of backward-incompatible changes from 2.4 to 2.9, many
> applications depending on Lucene, do not yet support it yet. I also tested Zekr
> with this version and it needs some changes in the code. I don't know how did
> you test it, but for sure Zekr doesn't work with original 2.9.0 package
> downloaded from apache.org <http://apache.org>.
>

I'm using the Debian package for lucene2. They don't seem to have done
intrusive changes in the source.

> Are you able to run Zekr and use advanced search with Lucene 2.9?
>

The advanced search works fine only for english text search, but doesn't
produce any error when looking for an arabic text, only 0 results. I
don't know if it was the case using former versions. The regular search
(and Root search) works fine even for arabic text.

Mohsen Saboorian

unread,
Dec 28, 2009, 5:34:38 AM12/28/09
to zekr...@googlegroups.com
Well, I just tested with 2.9.1 (downloaded from Debian repos) and it worked! To correct myself, 2.9.0 made a lot of APIs (including Hits/Hit) deprecated, which are then removed in 3.0.

I see the issue with Arabic search. It lists ayas numbers in which search term was found (without any aya text with highlighting) but incorrectly reports "0 results found". I will check to fix this soon inshaAllah.

Mohsen

Reply all
Reply to author
Forward
0 new messages