Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I wants to implement search feature like Micosoft OneNote Search Functionality.

Our Apllication is an Accounting Application which includes Creating Bill, Credits,PayBills etc,

The Search Box is available in the Home Window.

If the user starts type in the Search Box it should search all the basic transation table and show the result in a tree like structure just similar to the Microsoft OneNote Search Function.

Now I tried in the following way,

In the Editvalue changed property of the Devexpress TextEdit Box, I called a StroedProcedure to search and return the results using Entity Framework.

It works as similar to Microsoft OneNote, but the problem i faced here is to display the results it takes Long time.


The Number of rows returned by the stored procedure may vary based on the entries in the table, In our db currently am getting more than 20,000 rows if i type a single character, when the search term is getting more accurate the response time also improves.

How can I optimize the performance in this scenario?
Please provide me suggestions..


My Stored procedure like as follows..



C#
select 2 as pageNumber,null as Parent,'' as Child, 'BatchBill' as PageName,NEWID() as UniqueId,'' as EntryDate,'' as Code,'' as VendorName,'' as Invoice,'' as Reference,'' as Amount , '' as Memo from tbl1 where column1 like '%searchterm%' or column2 like '%searchterm%'

UNION

select 3 as pageNumber,null as Parent,'' as Child, 'Bill' as PageName,NEWID() as UniqueId,'' as EntryDate,'' as Code,'' as VendorName,'' as Invoice,'' as Reference,'' as Amount , '' as Memo from tbl3 where column1 like '%searchterm%' or column2 like '%searchterm%'

UNION

select 4 as pageNumber,null as Parent,'' as Child, 'Credit' as PageName,NEWID() as UniqueId,'' as EntryDate,'' as Code,'' as VendorName,'' as Invoice,'' as Reference,'' as Amount , '' as Memo from tbl2 where column1 like '%searchterm%' or column2 like '%searchterm%'

UNION

select 5 as pageNumber,null as Parent,'' as Child, 'Deposit' as PageName,NEWID() as UniqueId,'' as EntryDate,'' as Code,'' as VendorName,'' as Invoice,'' as Reference,'' as Amount , '' as Memo from tbl3 where column1 like '%searchterm%' or column2 like '%searchterm%' 





Thanks
Magesh
Posted
Comments
CHill60 12-Dec-15 7:57am    
Don't start the search until at least 3 characters have been entered.
You do realise that you are searching for anything containing the search term and not just starting with it.
And you don't appear to be actually returning any data from the tables
Magesh M N 14-Dec-15 0:15am    
The query i have been provided is just a sample query with default values..

Thanks for the suggestion of start search after 3 characters have been entered, I will discuss with our customers and try to achieve this..
Rajdeep Debnath 13-Dec-15 13:32pm    
You can provide search textbox auto-completion feature like google search to make sure near-exact term appears in your search.
Magesh M N 14-Dec-15 0:12am    
In our scenario, i think auto completion not helpful, because the user may type anything like (any number, any part of reference, any part of bill items name etc..)
Rajdeep Debnath 14-Dec-15 4:22am    
yes, correct. But google provides the same.

Over the time you will gradually find a trend/pattern of keywords input in the search box. If the keywords can be captured and ranked based on 'most frequently' used, the auto-completion feature will improve with time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900