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

Added Postgres Full Text Index together from Marten #110

Merged
merged 5 commits into from
Dec 6, 2023

Conversation

oskardudycz
Copy link
Contributor

@oskardudycz oskardudycz commented Nov 30, 2023

Moved the Postgres Full Text Index code from Marten.

Adjusted the naming to the Weasel and Postgres conventions:

  • class name from FullTextIndex to FullTextIndexDefinition
  • renamed DataConfig to DocumentConfig to align with PG naming and make it generic, as someone may use just regular column. Kept DataConfig as obsolete, to make easier transition for Marten users.

Moved both the definition and delta detection tests. Added base class for index tests, as next to be moved will be NGram index.

@oskardudycz oskardudycz added enhancement New feature or request indexing labels Nov 30, 2023
…efinition

Renamed setting DataConfig to DocumentCocument to align with PG naming and made it required
Added option to specify FullTextIndex through ColumnExpression
Added more tests
…migration for Marten users

Added more tests for FullTextIndexDefinition definition
Added common base class for index deltas detection tests
@oskardudycz oskardudycz marked this pull request as ready for review December 5, 2023 10:51
@oskardudycz oskardudycz added this to the 7.0.0 milestone Dec 5, 2023
Copy link
Member

@mysticmind mysticmind left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please check couple of comments added.

set => regConfig = value ?? DefaultRegConfig;
}

public string DocumentConfig { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

I do understand, you are initializing it in ctor, but still, for the setter, wouldn't you check the value for null and set it to DataDocumentConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we're using nullable reference types, the compiler will tell us we should not provide a null value there. If a user tries to cheat and forcibly put null, it's their mistake.

I'd like to get rid of DataDocumentConfig as it was my mistake to name it like that. Postgres names it document and if we put it into Weasel, then I think that we should keep naming generic.

I left DataDocumentConfig to not break people code when they upgrade Marten.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, make sense!

@oskardudycz oskardudycz merged commit a28cfe3 into master Dec 6, 2023
6 checks passed
@oskardudycz oskardudycz deleted the full_text_index branch December 6, 2023 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request indexing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants