Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

google like search syntax parsing (also posted in sql programming group)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
neilmcguigan@gmail.com - 29 Oct 2005 23:30 GMT
this is more of a text parsing/regex kind of question, but i figured
i'd start here. please let me know if this should go somewhere else.

I'd like to implement google-like search syntax, a la
http://www.google.ca/help/refinesearch.html

so a text query like this:

("google search" "regular expressions") OR (syntax text)
aSpecificField:somevalue

[some intermediate object that holds the expressions]

and turns into an sql query like this:

([aSpecificField] LIKE '%somevalue%') AND
(([field1] LIKE '%google search%' AND [field1] LIKE '%regular
expression%') OR ([field1] LIKE '%syntax%' AND [field1] LIKE '%text%'))
OR (([field2...repeat for all fields

basically i am having trouble figuring out how to parse the text query
to keep track of brackets and double-quoted expressions. am more
interested in parsing the text than turning it into SQL.

anyone have a reference that shows this being done?

thanks in advance!
Usenet Honey Pot - 30 Oct 2005 00:06 GMT
neilmcguigan@gmail.com wrote in news:1130625019.626696.87230
@g44g2000cwa.googlegroups.com:

> anyone have a reference that shows this being done?

Have you taken a look at SQL Server Full Text Search?

Signature

Stan Kee (spamhoneypot@rogers.com)

neilmcguigan@gmail.com - 30 Oct 2005 01:09 GMT
hi stan

thanks for your reply. i'm looking more for info on parsing strings to
keep track of quoted and parenthesized values.

thanks

neil
Kevin Spencer - 30 Oct 2005 04:42 GMT
Well, your original example had the phrase "Regular Expressions" in it, and
it sounds like you're on the right track there.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> hi stan
>
[quoted text clipped - 4 lines]
>
> neil
Usenet Honey Pot - 30 Oct 2005 06:45 GMT
neilmcguigan@gmail.com wrote in news:1130630988.933755.130820
@g14g2000cwa.googlegroups.com:

> thanks for your reply. i'm looking more for info on parsing strings to
> keep track of quoted and parenthesized values.

If you're going to manual parse - regular expressions is the way to go.

So basically you'll need to perfect your regular expression (Maybe use Sub-
Group matching?)

Signature

Stan Kee (spamhoneypot@rogers.com)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.