Is there a webpart for searching a WSS site?

I am using the search from the Microsoft Team site, and
it works well, but trying to modify it visually in Front
Page is driving me crazy.

RE: WSS Search Webpart? by v-wdxu

v-wdxu
Sat Feb 14 03:24:30 CST 2004

------=_NextPart_0001_68CB679C
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Dan,

Thanks for posting in the community!

From my understanding to this issue, you are going to use the search
function of WSS site in one web part.

I'd suggest you can use the methods "SearchDocuments" and "SearchListItems"
to search the documents or list data in the specified web site for the
specified string. I write one sample code for you.
//Code begin ---------------------------------------------------------
//I am researching the rootweb
try
{
SPSite siteCollection = new SPSite("http://<the url>");
SPWeb oRootSite = siteCollection.RootWeb;

SPSearchResultCollection oSRSet = oRootSite.SearchDocuments("<specified
search string>");
foreach( SPSearchResult oSR in oSRSet )
{
//you can test this code from one console applicatoin
first
//then create one web part with the codes
Console.WriteLine(oSR.Title);
}
}
catch( Exception exp )
{
Console.WriteLine( exp.Message );
}
//Code end ---------------------------------------------------------

Please feel free to let me know if you have any further questions.

Have a nice weekend!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_68CB679C
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Dan,
\par
\par Thanks for posting in the community!
\par
\par From my understanding to this issue, you are going to use the search function of WSS site in one web part.
\par
\par I'd suggest you can use the methods "SearchDocuments" and "SearchListItems" to search the documents or list data in the specified web site for the specified string. I write one sample code for you.
\par //Code begin ---------------------------------------------------------
\par //I am researching the rootweb
\par try
\par \{
\par SPSite siteCollection = new SPSite("http://<the url>");
\par \tab SPWeb oRootSite = siteCollection.RootWeb;
\par
\par \tab SPSearchResultCollection oSRSet = oRootSite.SearchDocuments("<specified search string>");
\par \tab foreach( SPSearchResult oSR in oSRSet )
\par \tab\{
\par //you can test this code from one console applicatoin first
\par //then create one web part with the codes
\par \tab\tab Console.WriteLine(oSR.Title);
\par \tab\}
\par \}
\par catch( Exception exp )
\par \{
\par \tab Console.WriteLine( exp.Message );
\par \}
\par //Code end ---------------------------------------------------------
\par
\par Please feel free to let me know if you have any further questions.
\par
\par Have a nice weekend!
\par
\par Wei-Dong Xu
\par Microsoft Product Support Services
\par Get Secure! - www.microsoft.com/security
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par }
------=_NextPart_0001_68CB679C--


RE: WSS Search Webpart? by dankruger

dankruger
Sat Feb 14 09:54:24 CST 2004

Thanks for the reply. I am using WSS only, not SPS. Would
your solution apply?

>-----Original Message-----
>Hi Dan,
>
>Thanks for posting in the community!
>
>From my understanding to this issue, you are going to use
the search
>function of WSS site in one web part.
>
>I'd suggest you can use the methods "SearchDocuments"
and "SearchListItems"
>to search the documents or list data in the specified web
site for the
>specified string. I write one sample code for you.
>//Code begin ---------------------------------------------
------------
>//I am researching the rootweb
>try
>{
> SPSite siteCollection = new SPSite("http://<the
url>");
> SPWeb oRootSite = siteCollection.RootWeb;
>
> SPSearchResultCollection oSRSet =
oRootSite.SearchDocuments("<specified
>search string>");
> foreach( SPSearchResult oSR in oSRSet )
> {
> //you can test this code from one
console applicatoin
>first
> //then create one web part with the
codes
> Console.WriteLine(oSR.Title);
> }
>}
>catch( Exception exp )
>{
> Console.WriteLine( exp.Message );
>}
>//Code end ---------------------------------------------
------------
>
>Please feel free to let me know if you have any further
questions.
>
>Have a nice weekend!
>
>Wei-Dong Xu
>Microsoft Product Support Services
>Get Secure! - www.microsoft.com/security
>This posting is provided "AS IS" with no warranties, and
confers no rights.

RE: WSS Search Webpart? by v-wdxu

v-wdxu
Mon Feb 16 00:50:09 CST 2004

------=_NextPart_0001_552DC632
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Dan,

Thank you for replying! It is my pleasure to be of service for you!

I tested the sample code in one WSS site which works very well! From my
experience, you can test this from one console applicatoin first and then
add this search feature into your web part.

Please feel free to let me know if you have any further questions.

Have a nice day!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
------=_NextPart_0001_552DC632
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fswiss\fprq2\fcharset0 Verdana;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Hi Dan,
\par
\par Thank you for replying! It is my pleasure to be of service for you!
\par
\par I tested the sample code in one WSS site which works very well! From my experience, you can test this from one console applicatoin first and then add this search feature into your web part.
\par
\par Please feel free to let me know if you have any further questions.
\par
\par Have a nice day!
\par
\par Wei-Dong Xu
\par Microsoft Product Support Services
\par Get Secure! - www.microsoft.com/security
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par }
------=_NextPart_0001_552DC632--


RE: WSS Search Webpart? by Dan

Dan
Wed Feb 18 09:26:10 CST 2004

Can this code be modified to search all workspaces
associated with a team site?

Thanks,

Dan


>-----Original Message-----
>Hi Dan,
>
>Thank you for replying! It is my pleasure to be of
service for you!
>
>I tested the sample code in one WSS site which works very
well! From my
>experience, you can test this from one console
applicatoin first and then
>add this search feature into your web part.
>
>Please feel free to let me know if you have any further
questions.
>
>Have a nice day!
>
>Wei-Dong Xu
>Microsoft Product Support Services
>Get Secure! - www.microsoft.com/security
>This posting is provided "AS IS" with no warranties, and
confers no rights.