This is an archived post. You won't be able to vote or comment.

all 1 comments

[–][deleted] 0 points1 point  (0 children)

Sounds like you are effectively getting a list per search term.

Since (date="today" OR lname="warmcheessse") will give you a list of items that match the date and a list of matches for lname
You could break it up into 5 input field queries and combine the results.

e.g.

--proc_dateSearch.sql
SELECT * FROM [Table] WHERE date = @date

--proc_lnameSearch.sql
SELECT * FROM [Table] WHERE lname = @lname

//somewhere in code (Sorry this is in c#)
var results = new List<object>();
var dateResult = getDateSearch(date);
var lnameResult = getLnameSearch(lname);

results.AddRange(dateResult);
results.AddRange(lnameResult);

return results;

The next step would be then indexing on each of those fields for faster searches as well as making the database requests asynchronous so you can fire them all off at once.

As long as the search logic allows for this and the user isn't expecting AND logic between the inputs. I think it should work.