This Post is a continuation of last on on how we can use SharePoint OoB Web Services to search not only for document but also create filter and query like filter File Extension "Aspx" pages that could have Web Parts or refine our searches....
For this Project i use a external tool to help me make Query's in existing Scopes
also add the url http://[Site]/_vti_bin/search.asmx
The SharePoint Search uses Scopes, each one will have rules used to index content of SharePoint and not SharePoint Sites.
http://fastforsharepoint.codeplex.com/
As developer or SharePoint Site administrator you can use SharePoint Default Services to collect information and used to display and for this example i will use the Search Scope "All Sites".
Pre-Requisite:
The Search Service and scopes to index the SharePoint content Sites has to be configured...
Query example:
SELECT Title, Rank, Size, Description, Write, Path,FileExtension
FROM Scope() WHERE ( ("SCOPE" = 'All Sites') ) and FileExtension ='aspx'
and contains(Path,'"http://[Site]/"') ORDER BY "Rank" DESC ]];
- portal..scope() WHERE ( ("SCOPE" = 'All Sites') )
- This parameter will make the filter to the Scope "All Site you can use "
- FileExtension ='aspx'
- This parameter will make the filter to all "aspx" Page
- contains(Path,'"http://[Site]/"')
- This parameter the make query to refine or restrict the access of the content, in this case i use the url,can be Site collection URL or even to the List. Example: contains(Path,'"http://[Site]/Lists/Contacts"') to return aspx file where are store the WebPart Pages...
If we select to execute the Query will return all the aspx page that could have WebParts.
The Below image is a test that returns all types of documents.
After you create you query and validate you can use the Visual Studio 2010 to use the proxy Search web Service from SharePoint in your Web form application and create querys.
After i create the proxy to the Search you can add in our Windows forms application and export to a gridview.

After you collect this data you can use in other situation like create Custom Searches or collect specific Documents....
Hope you like...
After i create the proxy to the Search you can add in our Windows forms application and export to a gridview.
After you collect this data you can use in other situation like create Custom Searches or collect specific Documents....
Hope you like...
0 comentários:
Enviar um comentário