Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex search #3287

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Regex search #3287

wants to merge 10 commits into from

Conversation

JJK96
Copy link
Contributor

@JJK96 JJK96 commented Jul 8, 2024

Describe the pull request content
I added a regular expression search option.

To do this, I had to update Apache Lucene 5 major versions (from 3.6 to 8.11). I tested several languages and searching still works, however testing by native speakers might be necessary. Depends on AndBible/jsword#15. After merging, it might be necessary to invalidate the indexes for all documents.

Screenshots

image

@JJK96 JJK96 requested a review from tuomas2 July 8, 2024 20:10
@@ -142,7 +143,7 @@ android {
/** these config values override those in AndroidManifest.xml. Can also set versionCode and versionName */
defaultConfig {
applicationId = applicationIdStandard
minSdk = 23
minSdk = 26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What requires this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I'll check what breaks if I put it back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26): Lorg/tartarus/snowball/SnowballProgram;find_among([Lorg/tartarus/snowball/Among;I)I

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lucene requires this:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rather conserning in my opinion. We will drop support from very big amount of mobile phones if we drop android 6 and 7. Maybe we need to release two versions, one for old phones and one for new phones if we will merge this...

  • I will check and analyze play store statistics.

@@ -34,7 +34,6 @@ buildscript {
val jvmToolChainVersion by extra(17)
val coreKtxVersion by extra("1.13.1")
val sqliteAndroidVersion by extra("3.42.0")
val jswordVersion by extra("2.4.14")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

submodule requires CI stuff to be working also, will consider if I fix them or drop submodule stuff from here (of course help appreciated if possible).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look next week to see if I can get the pipelines running correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could also be something chatgpt will give us with a simple prompt

db/build.gradle.kts Outdated Show resolved Hide resolved
/** can we enable the main menu search button
*/
override val isSearchable: Boolean
get() = try { //TODO allow japanese search - japanese bibles use smartcn which is not available
!currentDocument!!.doesNotExist && "ja" != currentDocument!!.language.code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • todo: check japanese documents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I performed a quick check by copy-pasting part of the document and searching for it, which worked. But I don't speak/read Japanese, so I don't know if the results made any sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to consult my friend chatgpt. He speaks japanese for sure 😊

@tuomas2
Copy link
Contributor

tuomas2 commented Jul 15, 2024

  • implement invalidating old indices

@JJK96
Copy link
Contributor Author

JJK96 commented Aug 5, 2024

  • Bug: Regex search always searches whole bible, not the current book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for others
Development

Successfully merging this pull request may close these issues.

2 participants