I'm currently assigned with creating a custom search page from scratch. Thus, I need a query that will go through all of our site and find me pages that contain key words on these pages. Does sharepoint have a method I can call to retrieve such result?
1 Answer
Are they publishing pages and when you say keywords are they going to be fields on pages from layout pages? You need to explain your architecture and requirements a bit more.
There are two ways to get your pages.
1 - you may write a webpart to directly get all the pages using the object model with a caml query. 2 - you can use the enterprise or fast search to crawl your pages and use the search service to return results which will require some settings on the search service like scopes and metadata properties. In this case you can either use the search object model or search web service to get results.
if you give some more details whether you have made any decisions on these or you have requiremeents to use one of these approaaches I can provide more detail on objects and methods with examples.
-
All the pages on the site are customly made using "web.RootFolder.Files.Add()". And by keyword I mean any where on the page.– CaesarCommented Jul 16, 2012 at 20:45
-
Do you simply have pages with content and you want to type a word and search for all pages that have that word in the content. Commented Jul 16, 2012 at 20:59