efcore.pg icon indicating copy to clipboard operation
efcore.pg copied to clipboard

Support of jsonb along with other type

Open sowsan opened this issue 3 years ago • 0 comments

I have reported the issue here and it seems the solution is available in version 7. Would like does the fix work for creating a TsVector with a combination of String & JSONB types like below? Thanks for your help!

public class User : BaseEntity
    { 
        public string Title { get; set; }
      
        public string Description { get; set; }

        public List<string> Tags { get; set; }

        public NpgsqlTsVector SearchVector { get; set; }

    }
modelBuilder.Entity<UserBusinessInfo>()
          .HasGeneratedTsVectorColumn(
              b => b.SearchVector,
              "english",  // Text search config
              b => new { b.Title, T.Description, b.Tags })  // Included properties
              .HasIndex(b => b.SearchVector)
              .HasMethod("GIN"); 

sowsan avatar Sep 10 '22 21:09 sowsan