Count word occurrences in a text field with LINQ
- by Yoann. B
How can i get the occurrences count of a Word in a database text field With LINQ ?
Keyword token sample : ASP.NET
EDIT 4 :
Database Records :
Record 1 : [TextField] = "Blah blah blah ASP.NET bli bli bli ASP.NET blu ASP.NET yop yop ASP.NET"
Record 2 : [TextField] = "Blah blah blah bli bli bli blu ASP.NET yop yop ASP.NET"
Record 3 : [TextField] = "Blah ASP.NET blah ASP.NET blah ASP.NET bli ASP.NET bli bli ASP.NET blu ASP.NET yop yop ASP.NET"
So
Record 1 Contains 4 occurrence of "ASP.NET" keyword
Record 2 Contains 2 occurrence of "ASP.NET" keyword
Record 3 Contains 7 occurrence of "ASP.NET" keyword
Collection Extraction IList < RecordModel (ordered by word count descending)
Record 3
Record 1
Record 2
LinqToSQL should be the best, but LinqToObject too :)
NB : No issue about the "." of ASP.NET keyword (this is not the goal if this question)