Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / June 2007

Tip: Looking for answers? Try searching our database.

Parsing Google-like queries for FT search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Fabio Gava - 07 Jun 2007 10:20 GMT
I've successufully installed FT on a SQL Server 2000 used to manage images
database.
What I need now is a parser to translate "common use" query in FT correct
query, just to reduce the impact on web users on their searches on the site.

I guess I need something like:
http://ewbi.blogs.com/develops/2007/05/normalizing_sql.html but, since I
don't use MS techs on web server and I don't know anything about .NET, I
wondered if someone could suggest me any alternative, also if I don't need
such complexity (i don't care about proximity and subexpressions).

Many thanks.

Fabio
xyz - 07 Jun 2007 14:55 GMT
That little class wouldn't be too hard to convert to perl, although I don't
have a perl installation handy to convert it myself...  Maybe if you or
someone you work with is familiar with perl you could convert it...  Or
maybe you could contact the original author (his email address is in the
source listing) and ask him for help.

> I've successufully installed FT on a SQL Server 2000 used to manage images
> database.
[quoted text clipped - 11 lines]
>
> Fabio
tbh - 13 Jun 2007 10:06 GMT
hi, Fabio,

about a year ago i re-wrote our website's fulltext search and had very
similar questions. seems to me it would be a great open source
(mini-)project: doesn't need to be very big, but still takes more than half
an hour.

one question, the first replier to your question talked about perl, but i
didn't find any mention of perl in your question. what language are you
implementing in?

i implemented in C#. not sure whether my result is of much use to you, but i
can sketch how i proceeded. i basically support quotes, AND, OR, NEAR, and
NOT (which i promote to "AND NOT" if it isn't already written that way). i
eliminate naked (unquoted) noise words, and i eliminate a quoted chunk if it
contains only noise words. if 2 terms appear without an operator between
them, i treat them as ANDed -- which to me is what "net intuition" expects.

my Contains "getter" (C# term) begins as follows to give you an idea.

cheers,

Tim

/// <summary>

/// for many reasons it would be grand to support a real search grammar
(last and perhaps least because we could convert search terms to canonical
form for tagging)

/// but we don't yet (and our indexing has other problems such as not
allowing hyphens in words (thus we can't find wal-mart and g-8-gipfel)

/// so here is our poor man's quasi-grammar

/// </summary>

static Regex reBinarySearchOperators = new Regex(@"^(AND|OR|NEAR)$",
RegexOptions.IgnoreCase);

static Regex reUnarySearchOperators = new Regex(@"^(NOT)$",
RegexOptions.IgnoreCase);

public string Contains {

get {

if (IsEmpty) {

> I've successufully installed FT on a SQL Server 2000 used to manage images
> database.
[quoted text clipped - 11 lines]
>
> Fabio
Fabio Gava - 13 Jun 2007 13:08 GMT
> hi, Fabio,
>
[quoted text clipped - 6 lines]
> but i didn't find any mention of perl in your question. what language
> are you implementing in?

I'm using PHP5 for the website, but I would like to use the same function
also for administration software, written in Delphi7. This is the reason why
I was looking for a solution implemented directly on database side. With
SQL2005 you can declare external stored function using win DLL (this was
true also on SQL2000) and any CLR language.
This was the solution I got from the author of the function linked in my
first message.
I'm planning of testing this way in the next couple of days, otherwise we
are planning of translating that C# code in Delpy to create a DLL.

> i implemented in C#. not sure whether my result is of much use to
> you, but i can sketch how i proceeded.
It's exactly what I'm planning to test: use the C# code as an external
stored procedure. Did you already try this approach?

Many thanks.

-fabio
tbh - 13 Jun 2007 13:53 GMT
hi, Fabio,

>> i implemented in C#. not sure whether my result is of much use to
>> you, but i can sketch how i proceeded.
> It's exactly what I'm planning to test: use the C# code as an external
> stored procedure. Did you already try this approach?

no, that's an interesting idea, though. we are fairly flexible about what
logic we put in DLLs, Stored Procedures, User Defined Functions, Triggers,
and "application code", but we have not yet called home-grown DLL code in
the database, though we've heard about it.

good luck with your approach!

cheers, Tim
Mike C# - 13 Jun 2007 20:07 GMT
> one question, the first replier to your question talked about perl, but i
> didn't find any mention of perl in your question. what language are you
> implementing in?

The poster specifically said they don't know anything about .NET.  That
implies that the programmer did not know how to program VB, C#, or other
.NET languages (the sample the OP linked to was in C#).  Thus the suggestion
to convert it to Perl (or some other language the OP, or someone in his
company *does* know).
 
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



©2009 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.