Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search in WSS 2

Status
Not open for further replies.

planetant

IS-IT--Management
Mar 15, 2005
55
US
Wondering if there is a search function in WSS for text and title of documents at any level of directory.

Anyone know how it works? If there is none, anyone using any content management with search.

At my old company we had VSS which had a great function. Looking for something similar.

_Heather
 
Hello,

WSS only has a simple search which is a SQL fulltext search. You can search only for content in the site you execute the query in, if you have subsites within a site collection those will not be searched.
The simple search in WSS is not customizable by default and it can not just be set to search for text and title of documents (however those things will also be displayed when executing a query).

You might want to check out PowerSearch for WSS you can find it at
Regards,
Thomas
 
Hi Heather,

You could write your own webpart that does this, i have!

you could also alter the Stored Procedure in the database to search in AND mode and not OR as WSS does by default.

1. Go into SQL Enterprise Manager and open the stored procedure called proc_FetchDocSearchResults (make a backup)
2. Add the following lines to the procedure before the line "SET
NOCOUNT ON":
DECLARE @CustSearchTerm nvarchar(255)
SET @CustSearchTerm = '"' + @SearchTerm + '"'
3. Find the word FreeTextTable and replace it with ContainsTable
4. In the same line change the variable @SearchTerm to @CustSearchTerm
(thanx to the person i got this from i can't remember who it was.)

then a bit of code for the webpart...
Code:
SPSite mySiteCollection = new SPSite(servernaam);
SPWeb oRootSite = mySiteCollection.OpenWeb(<empty if you search on top site else "/subsite name>); //you can use this to go trough any number of sites, just make a loop.

PSearchResultCollection oSRSet = oRootSite.SearchDocument(searchstring);

foreach( SPSearchResult oSR in oSRSet )
{
//oSR.Url //make output
//oSR.Title
}


Interface:
TextBox tb;
ImageButton btn_search;
LiteralControl lc;
protected override void CreateChildControls()
{
   tb=new TextBox();  //searchbox
   tb.Width=180;
   tb.Style["vertical-align"] ="3";
   tb.MaxLength=255;
   tb.CssClass="ms-searchbox";
   Controls.Add(tb);
   Controls.Add( new LiteralControl(" ") );
   

   btn_search=new ImageButton();  //Zoek knop icoon
   btn_search.Style["vertical-align"] ="1";
   btn_search.ImageUrl="_layouts/images/gosearch.gif"; 
   Controls.Add(btn_search);

   lc=new LiteralControl(); 
   lc.Text="<br>";
   Controls.Add(lc);
}

Then write something to compare the path of the search result with the scope you are looking in an you have an scope enabled seach webpart. (i get the scope send to the webpart from my navigation webpart)

Greetings from ChaserNL

 
Hello ChaserNL,

Great post! Thanks for sharing that! A star for you! :)

Regards,
Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top