Changeset 7dd2ea2


Ignore:
Timestamp:
10/11/21 13:49:13 (3 years ago)
Author:
Стојков Марко <mst@…>
Branches:
dev
Children:
7f1a891, b25b9ea
Parents:
cba21c9 (diff), f71994c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Fulltext search

Location:
src/FinkiChattery
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/FinkiChattery/FinkiChattery.Database/FullTextSearch/FullTextIndexQuestion.sql

    rcba21c9 r7dd2ea2  
    1 CREATE FULLTEXT INDEX ON [dbo].[Question] ([Title], [Text])
     1CREATE FULLTEXT INDEX ON [dbo].[Question] ([Search])
    22KEY INDEX [PK_Question] ON [QuestionFullTextCatalog]
    3 WITH (CHANGE_TRACKING AUTO, STOPLIST OFF)
     3WITH (CHANGE_TRACKING AUTO)
  • src/FinkiChattery/FinkiChattery.Database/dbo/Tables/Question.sql

    rcba21c9 r7dd2ea2  
    99    [Views]        BIGINT           DEFAULT (CONVERT([bigint],(0))) NOT NULL,
    1010    [LastActiveOn] SMALLDATETIME    NOT NULL,
     11    [Search]       AS ([Title] + ' ' + [Text]),
    1112    CONSTRAINT [PK_Question] PRIMARY KEY CLUSTERED ([Id] ASC),
    1213    CONSTRAINT [FK_Question_Student_StudentFk] FOREIGN KEY ([StudentFk]) REFERENCES [dbo].[Student] ([Id]),
  • src/FinkiChattery/FinkiChattery.Persistence/Configurations/QuestionConfig.cs

    rcba21c9 r7dd2ea2  
    2424            builder.Property(x => x.Views).HasColumnName(@"Views").HasColumnType("bigint").IsRequired().HasDefaultValue(0);
    2525            builder.Property(x => x.LastActiveOn).HasColumnName(@"LastActiveOn").HasColumnType("smalldatetime").IsRequired();
     26            builder.Property(x => x.Search).HasColumnType(@"Search").HasColumnType("nvarchar").HasMaxLength(4000).IsRequired();
    2627
    2728            builder.HasOne(x => x.Student).WithMany(x => x.Questions).HasForeignKey(x => x.StudentFk).OnDelete(DeleteBehavior.NoAction);
  • src/FinkiChattery/FinkiChattery.Persistence/Models/Question.cs

    rcba21c9 r7dd2ea2  
    3232        public DateTime LastActiveOn { get; set; }
    3333
     34        public string Search { get; set; }
     35
    3436        public virtual ICollection<Answer> Answers { get; set; }
    3537
    3638        public virtual ICollection<QuestionCategory> QuestionCategories { get; set; }
    37 
    38         // TODO: Pole po koe ke pravime queries
    3939    }
    4040}
Note: See TracChangeset for help on using the changeset viewer.