Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Custom Search query

  Asked By: Marla    Date: Apr 21    Category: Sharepoint    Views: 1378

I have created custom search web part and wanted to restrict the search only to
few Wss sites under portal .How do i write this query in c#



8 Answers Found

Answer #1    Answered By: Candis Kinney     Answered On: Apr 21

Your best bet is to setup a content group with the sites  you want, then use the
Search web  service or the object model to query  against that group.

Answer #2    Answered By: Cora Bradshaw     Answered On: Apr 21

I did not get you.
Can this not be done in fulltext search  query .
actually i already wrote the query  but it shows me all the data.I want to
restrict the result to specific sites  which willl be chosen dynamically by user
,hence i wanted  to do it from full text search query

Answer #3    Answered By: Shushma Zariwala     Answered On: Apr 21

Sorry, when you said portal  I assumed you were talking about SPS (which doesn't
use fulltext search). I don't know if it's possible to do what you are asking
using SQL fulltext search.

Answer #4    Answered By: Bahadur Kotoky     Answered On: Apr 21

You could iterate throught the SPWebCollection, calling the SearchListItems
method for each web  you want to search, then take the results for each and
concatenate together. This would be a bit of programming, but is definitely

Answer #5    Answered By: Jeremey Avery     Answered On: Apr 21

I still got one question ,that will SearchListItems help in getting data based
on content of document or on the name of document

Answer #6    Answered By: Mariel Ferrell     Answered On: Apr 21

SearchListItems returns a SearchResultCollection, which is the same thing that
the Searchresults.aspx page that comes standard with WSS returns, so any
capabilities of WSS search  (which is quite limited compared to SPS) are enabled.
Specifically, it can search list fields and document text, assuming you have the
right filters (e.g. for PDFs).

Answer #7    Answered By: Santana Osborn     Answered On: Apr 21

For searching documents you'll need the SearchDocuments method instead. While
the SDK doesn't say specifically whether it includes document contents, since it
requires FT indexing to be enabled, there a good chance it does.

Answer #8    Answered By: David Brown     Answered On: Apr 21

Thanks for catching my mistake - SearchDocuments is the way to go.

Didn't find what you were looking for? Find more on Custom Search query Or get search suggestion and latest updates.