Reputation: 1
I have a table named “Articles” which contains an Article_body field which might contain more than 1000 characters for each record. And i have a search web page to search these articles by inserting any string and retrieve all the articles that contains this string in their Article_body field .i am currently doing this using the .contain method as following:-
**public IQueryable<Question> searcharticles(string q)
{
return from a in entities1.articles
where (a.article_body.Contains(q)
select u;}**
Currently the search is working fine, but i am afraid that when i will have thousands of articles this might not work efficiently, so i have the following two questions:-
Upvotes: 0
Views: 97
Reputation: 17485
Assuming that you have SQL Server
There are couple of way you can improve performance.
Create proper non-clustered index with covering column as well.
( Read about cover index)
Full Text Search of SQL Server but this require enterprise licence if you want to host online
Try Lucene Indexing
Upvotes: 3
Reputation: 18965
Have you looked into Full Text Search (assuming your database is SQL server)?
Upvotes: 3