Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm in a process of extending CoreResultsWebPart - I'm trying to create something like "Who is Blogging" to show you most recent blogs from people. Following properties will be changed - so that when used it will be set as default.

  1. XslLink (Done)
  2. Location (to only Local Search Results)
  3. Sorting

I'm unable to find how to setup Location. There is a property called Location which takes string. However I have tried with "LocalSearchResults" and I't doesn't work.

This is my code so far:

public class WhosBloggingWebPart : CoreResultsWebPart
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            base.UseLocationVisualization = false;
            base.XslLink = @"/Style%20Library/XSL%20Style%20Sheets/WhosBloggingModule/WhosBloggingXSLT.xslt";

            this.Location = "LocalSearchResults";
            this.FixedQuery = "contenttype:post AND NOT Title:\"Welcome to your Blog!\" AND url:\"*/site/*\"";
            this.QueryNumber = QueryId.Query2;

            this.DefaultSort = ResultsView.Modified_Date;
        }
    }
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Set the location value to LocalSearchIndex

this.Location = "LocalSearchIndex";
share|improve this answer
    
How do you know this? I spend hours going over msdn and couldn't find anything. –  Luke Aug 2 '12 at 21:18
    
@Luke I read the location property into a string variable then debuged the web part and watched the value as I set the property of the web part in the UI. –  Aquila Sands Aug 3 '12 at 7:14
    
Nice. Good idea! I though it is actually documented somewhere. –  Luke Aug 5 '12 at 21:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.