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