mayB2morrow
Programmer
Hi there,
I am currently working on a project which involves the implementation of some database seraching based on user input.
I need to mimic the functionality of a search engine search box in my search - i.e. parse characters such as "", +, - , or etc. to create advanced search criteria.
I need some code which would convert this user input into SQL search criteria.
e.g if someone were to type into my search box....
"experts exchange" or Phil Marsay -unix
would translate to something like...
field like '%experts exchange%' or (field like '%Phil%' and field like '%marsay%') and field not like '%unix%'
You get the idea, I am sure this must have been done somewhere before. I'm not really interested in ranking results or anything like that - the search results will just match everything in the criteria or not show up.
Any help, pointers to info, or code snippets most greatfully accepted! Preferably c# as that is what I am working on, but if there are any examples in other languages, I will gladly take a look at those too!
Thanks in advance,
Phil Marsay
I am currently working on a project which involves the implementation of some database seraching based on user input.
I need to mimic the functionality of a search engine search box in my search - i.e. parse characters such as "", +, - , or etc. to create advanced search criteria.
I need some code which would convert this user input into SQL search criteria.
e.g if someone were to type into my search box....
"experts exchange" or Phil Marsay -unix
would translate to something like...
field like '%experts exchange%' or (field like '%Phil%' and field like '%marsay%') and field not like '%unix%'
You get the idea, I am sure this must have been done somewhere before. I'm not really interested in ranking results or anything like that - the search results will just match everything in the criteria or not show up.
Any help, pointers to info, or code snippets most greatfully accepted! Preferably c# as that is what I am working on, but if there are any examples in other languages, I will gladly take a look at those too!
Thanks in advance,
Phil Marsay