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

Add support for FTS #1300

Merged
merged 5 commits into from
Jun 6, 2023
Merged

Add support for FTS #1300

merged 5 commits into from
Jun 6, 2023

Conversation

nirinchev
Copy link
Member

Adds an optional positional argument to the @Indexed annotation that enables running TEXT queries:

@RealmModel()
class _Book {
  late String title;

  @Indexed(RealmIndexType.fullText)
  late String summary;
}

final books = realm.query<Book>("summary TEXT \$0", "fantasy novel")

Fixes #1248.

Copy link
Contributor

@nielsenko nielsenko left a comment

Choose a reason for hiding this comment

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

Assuming you are right about DateTime not being a valid primary key, which is odd given that it is indexable.

CHANGELOG.md Show resolved Hide resolved
@cla-bot cla-bot bot added the cla: yes label May 30, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
generator/lib/src/field_element_ex.dart Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented May 31, 2023

Pull Request Test Coverage Report for Build 5187739159

  • 30 of 32 (93.75%) changed or added relevant lines in 4 files are covered.
  • 88 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.03%) to 89.251%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/src/realm_property.dart 0 2 0.0%
Files with Coverage Reduction New Missed Lines %
lib/src/realm_class.dart 1 93.93%
lib/src/native/realm_core.dart 87 90.75%
Totals Coverage Status
Change from base Build 5123836006: -0.03%
Covered Lines: 3147
Relevant Lines: 3526

💛 - Coveralls

@nirinchev
Copy link
Member Author

The macOS test failure is a timeout of the tests after 45 minutes, while the Ubuntu 20 failure is the Realm.logger supports logging from multiple isolates test and it seems unrelated to these changes.

Copy link
Contributor

@blagoev blagoev left a comment

Choose a reason for hiding this comment

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

Added some suggestions. And I think we should remove RealmIndexType.none. It adds very little value and makes the API weird and prone to runtime errors.

CHANGELOG.md Outdated Show resolved Hide resolved
common/lib/src/realm_types.dart Outdated Show resolved Hide resolved
common/lib/src/realm_types.dart Show resolved Hide resolved
generator/lib/src/field_element_ex.dart Show resolved Hide resolved
generator/lib/src/field_element_ex.dart Outdated Show resolved Hide resolved
generator/lib/src/field_element_ex.dart Show resolved Hide resolved
generator/lib/src/realm_field_info.dart Outdated Show resolved Hide resolved
lib/src/realm_property.dart Outdated Show resolved Hide resolved
test/indexed_test.dart Show resolved Hide resolved
@nirinchev nirinchev requested a review from blagoev June 6, 2023 12:30
@nirinchev nirinchev merged commit 6b23069 into main Jun 6, 2023
48 checks passed
@nirinchev nirinchev deleted the ni/fts branch June 6, 2023 13:10
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose minimal Full text search
5 participants