Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 8th, 2007, 05:49 PM
Authorized User
 
Join Date: Jun 2006
Location: , , USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anyone created a search module?

Any created a search module yet?
Please help on how to get started.

http://TranChauQuan.com

  #2 (permalink)  
Old August 9th, 2007, 04:03 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

yes,

i created one on my site and use the sqlserver free-text searching facility on that. For simplicity, let's just deal with the current TBH modules. For the Articles and Posts, i just created the index on the Body, Title (and in the case of Articles, also, the Abstract). the sql to do this is illustrated below:

Firstly, create the storage for the indexes and give them appropriate names:

use TBHLocalSqlServer -- the name of the database registered in sqlserver
go
EXEC sp_fulltext_database 'enable'
go
CREATE FULLTEXT CATALOG my_Articles
go

use TBHLocalSqlServer -- the name of the database registered in sqlserver
go
EXEC sp_fulltext_database 'enable'
go
CREATE FULLTEXT CATALOG my_Posts
go


Next, add the indexes to the storage:

create FULLTEXT INDEX ON dbo.tbh_Articles
(
Body,Abstract,title
Language 0X0
)
KEY INDEX PK_tbh_Articles ON my_Articles
WITH CHANGE_TRACKING AUTO

create FULLTEXT INDEX ON dbo.tbh_Posts
(
Body,title
Language 0X0
)
KEY INDEX PK_tbh_Posts ON my_Posts
WITH CHANGE_TRACKING AUTO

And that's the freetext indexes setup. Now you have to create a generic query for these using the Contains() keyword:

i.e (this is not the sql i use, just an illustrative excerpt):

select * from (
select 'ShowArticle.aspx?ID=' + convert(nvarchar,tbh_articles.ArticleID)
+ '&search=' + @search as linkid,
tbh_articles.abstract as descriptiontext,
tbh_articles.title as title, 'article' as source from tbh_articles
where contains(body, @whereclause)
or contains(abstract, @whereclause)
or contains(title, @whereclause)

-- need to do a bit of work on the posts part to remove
-- duplicates and retain single line per post
union

select 'ShowThread.aspx?ID=' + convert(nvarchar, tbh_Posts.PostID)
+ '&search=' + @search as linkid,
convert(nvarchar(4000), tbh_posts.body) as descriptiontext,
tbh_posts.title as title, 'posts' as source from tbh_posts
where (contains(body, @whereclause)
or contains(title, @whereclause))
and approved=1

) results

(thanks to vantoko for the above idea for the sql). Behind the scenes, i've created a SearchItem BLL and DAL in the same paradigm as THB. I also have a usercontrol composed of a textbox and a button. this basically fires a redirect to my searchpage with the search criteria as parameters.

You can see this running if you go to my test site (see below). suggested search terms (multiple words on a single line) to see it working (i only have a limited amount of data at present) are (but not limited to :D):

bbc itv
mika new york
beer

i'll probably post the source code and full instuctions in a few weeks, but for now i'm in a phase of attempting to deliver a several things so can't really get down to that yet.

Hope the pointers above give enough to get you thinking of approaches.

jimi

http://www.jamestollan.com
  #3 (permalink)  
Old August 9th, 2007, 05:06 AM
Friend of Wrox
 
Join Date: Mar 2007
Location: Creetown, UK
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

ok - i quickly put together the components of my search module. you can grab it here:

http://www.jamestollan.com/downloads/searchV1.2.zip

the only 'sticky' point will be the fact that user rights and familiarity with sql server management studio express are pretty much a pre-requisite to setting up the initial free-text indexing side of things. i've tried in my little readme in the zip, to detail the steps and have included the relevant scripts to automate this. however, i just KNOW that it won't be straightfwd for everyone. in this case, i'd urge the 'community' to try and help out those struggling with this admin side of things.

ok -enjoy

[edit] doanhvu, perhaps (if you wanted to) you could share your WebChat code. looks like a good starting point for a basic p2p chat facility). Also, minor issue with SQL, have updated zip to version searchV1.1.zip - redownload to get full amendments

jimi

http://www.jamestollan.com
  #4 (permalink)  
Old August 9th, 2007, 10:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here's a search article that Marco recently published:

http://msdn.microsoft.com/msdnmag/is.../09/WebSearch/

I am not personally a fan of Sharepoint, but it has it's place in a corporate intranet. Also, some hosting companies offer it (like WebHost4Life).

Regarding chat, I made some low-level components for plaintext and encrypted sockets. I wanted to set up a chat server on port 443 because I figured most companies don't block that port and I could use encryption to hide the traffic. But it turns out most modern firewalls used by businesses actually inspect port 443 traffic looking for an SSL session ID so my plan didn't work out.

The only way to pass chat traffic through corporate firewalls is to mask it inside HTTP or HTTPS packets. I didn't implement that yet but it seems plausible. We could stick encrypted base64 data inside a valid HTTP packet and the firewalls should let it through.

Eric

  #5 (permalink)  
Old August 11th, 2007, 08:14 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: , , .
Posts: 142
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via MSN to vantoko
Default

Hi,

I tried the live search integration a year ago and I don't really like it.
First of all you are dependant on how live search indexes your site
Second, you need to provide a full dns name and that something that hosting providers don't always like to open on their sites (bad practice) since live search uses dynamic IP adresses, you need to open a whole range of addresses in your firewall (I discussed this with the live product team and they were looking for a solution for this)

koen

  #6 (permalink)  
Old August 11th, 2007, 06:06 PM
Authorized User
 
Join Date: Jun 2006
Location: , , USA.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

As Someone mentioned about the coding for Webchat control, it can be downloaded with full explanation.
Just go to Google with keyword "Asp.net Webchat"

  #7 (permalink)  
Old August 12th, 2007, 12:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I guess you mean the AJAX chat program by Steve Orr:

http://steveorr.net/articles/WebChat.aspx

This looks terrific! I read Steve's articles in ASP.NET Pro magazine and I love his writing style.

If we used this with SSL it would be private but we'd have to leverage an SSL certificate from our web host provider. I'd like to make something like this with simple encryption that would allow private chats without SSL. We'd probably need a JavaScript encyption/decryption set of functions. That seems doable.

Eric

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Announce: Search Module for TBH available jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 54 August 9th, 2009 04:42 PM
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
Search module vantoko BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 August 7th, 2007 07:48 AM
New text search doesn't preselect search string planoie Visual Studio 2005 0 July 23rd, 2007 06:47 AM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 09:15 PM



All times are GMT -4. The time now is 10:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.