?
Solved

How can I use my SQL Full-Text search to enquire through a web browser with some sort of ASP etc?

Posted on 2003-02-28
8
Medium Priority
?
343 Views
Last Modified: 2008-03-06
I am trying to setup a search engine to enquire against a database using the FULL-TEXT Search Catalogs that I have created in SQL Sevrer 2000.

The SQL Server Query that I wish to use is below and it joins three tables.

SELECT
S_SRV_REQ.SR_NUM AS "ID",
S_SRV_REQ.SR_TITLE AS "Title",
S_SRV_REQ.DESC_TEXT AS "Description",
S_RESITEM.RESOLUTION_TEXT AS "Solution",
S_SR_RESITEM.COMMENTS AS "Comments"
FROM S_RESITEM
INNER JOIN S_SR_RESITEM ON S_RESITEM.ROW_ID=S_SR_RESITEM.RESITEM_ID
INNER JOIN S_SRV_REQ ON S_SR_RESITEM.SR_ID=S_SRV_REQ.ROW_ID
WHERE CONTAINS (S_SRV_REQ.DESC_TEXT, '<SEARCH TEXT>')

In SQL Server Query Analyzer I can run the above query replacing <SEARCH TEXT> with for example "Sales Invoices" and it returns what I need from the Full-Text search catalogs.

How can I use my SQL Full-Text search to enquire through a web browser with some sort of ASP etc?
0
Comment
Question by:Mickey_Nunes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 472 total points
ID: 8043687
No different from ASP or any other front-end.  Although you would be better off to use a Stored Procedure to do this.

If you have more than one column in your Full Text Catalog, you can use:
WHERE CONTAINS (S_SRV_REQ.*, '"Sales Invoices"')

By the way notice the double quotes within the single quotes around the phrase.

Anthony
0
 
LVL 4

Assisted Solution

by:crosenblum
crosenblum earned 464 total points
ID: 8046788
there are different commands for sql server's free text searching...

first it has to be set up in the sql server database as a full-text enabled table/tables. then you need to specify those table/tables and what fields will be indexed. preferablly fields that are already indexed for performance and data collection...

Then you need to find the right term to join against regular data for the free text searching...

freetext
freetexttable
contains
containstable

each has their cost/benefit analysis...

do you need a ranking system?

is the results to be specific or open-ended?

That's the kind of questions you need to answer...

then it's a matter of matching the correct pattern to the need.
0
 
LVL 2

Assisted Solution

by:rbagdonas
rbagdonas earned 464 total points
ID: 8050929
First build a stored proc.

create procedure SearchStuff

@SearchText varchar(50)

AS

SELECT S_SRV_REQ.SR_NUM AS "ID",
S_SRV_REQ.SR_TITLE AS "Title",
S_SRV_REQ.DESC_TEXT AS "Description",
S_RESITEM.RESOLUTION_TEXT AS "Solution",
S_SR_RESITEM.COMMENTS AS "Comments"

FROM S_RESITEM
INNER JOIN S_SR_RESITEM ON S_RESITEM.ROW_ID=S_SR_RESITEM.RESITEM_ID
INNER JOIN S_SRV_REQ ON S_SR_RESITEM.SR_ID=S_SRV_REQ.ROW_ID
WHERE CONTAINS (S_SRV_REQ.DESC_TEXT, @SearchText)

GO

Then in an ASP page you need to create a connection and run the stuff.  Eventually you will want to move away from connection stuff in ASP and put it in a COM+ layer.  But for now this will work.

'create the connection
Set Conn = Server.CreateObject......

'open the connection
Conn.Open ConnString

'Execute your stored proc
Set rs = Conn.Execute ("SearchStuff @SearchText='" & VariableThatContainsYourSearchText & "'")

do what you want with the recordset here.

If you are new to learning ASP, you might want to post ASP questions in that section.

R
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 8676825
Do you need any more help with this question?

Anthony
0
 

Expert Comment

by:CleanupPing
ID: 9276230
Mickey_Nunes:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 9313492
I suggest split the points between all contributors.

Anthony
0
 
LVL 34

Expert Comment

by:arbert
ID: 10910728
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.  

I will leave the following recommendation for this question in the Cleanup topic area:

Split points between acperkins, rbagdonas, and crosenblum

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

Arbert
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question