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

Where in XSL of the result web part I can put IsDocument=true. I already added isdocument for fetch column xml.

  1. Added <Column Name="IsDocument"/> in Fetched Properties

    2. 
    
        Added this in XSL
    
        <xsl:param name="IsDocument">True</xsl:param>
    

    .

  2. Finally modify following to add

    if IsDocument

      <xsl:template match="Result"> 
            <xsl:if test="$IsDocument = 'True'">
        <xsl:variable name="isdocument" select="isdocument"/>
              <xsl:variable name="id" select="id"/>
              <xsl:variable name="currentId" select="concat($IdPrefix,$id)"/>
              <xsl:variable name="url" select="url"/>           
             </xsl:if>
    

    But the page does not render and gives error.

share|improve this question
    
Basically, I am trying to use contextual search but it's bringing back everything (like site, arcgis xml pages, etc.) and the pdf, word, excel, autocad files. I have created scopes but their is no way for sub sites to pick up it's respected scope (not that i know of) unless there is jquery or javascript way. that's why I am using contextual search. Guys I really need some brain here. –  Maria Burton Sep 25 '13 at 20:29
    
I am not clear on what you want to achieve? Fetched Properties is used to pull back search Managed Properties which are mapped to crawled properties - so do you have a Managed Property called IsDocument and what is it mapped to? –  Dave Paylor Sep 25 '13 at 21:04

1 Answer 1

up vote 0 down vote accepted

You don't put it in the XSL, you put it in the Additional Query property of the Core Search Results Web part. If that isn't the solution can you edit your question to tell us what you are trying to achieve?

share|improve this answer
    
Hi Matt, okay here is the requirement. I have 15 sub-sites under Legal and I have 15 search scopes for each sub-site. and 1 search scope foe Legal site collection. The problem is that when user goes to a sub-site the respected scope for the sub-site is not automatically selected like you would have for contextual search scope. If I use "Show and default to contextual scope" then sub-site scope drop-down are automatically selected when user goes to diff sub-sites. However, the result is crappy. It brings everything. (forms, url, site, documents, xml, style page). That's the reason. –  Maria Burton Sep 26 '13 at 11:51
    
Maria, there are a couple ways to do this, you can even get rid of the 15 scopes. Create a search results page with an additional query term of IsDocument=1 and then from each site have the search box add the site to the query site:legal/site/site then the user can see only results for the site or choose to change thier query by changing tabs. BTW, in 2013 the library search will solve this for you. –  Matthew McDermott Sep 27 '13 at 12:18
    
I got the first part with IsDocument. The second part is bit confusing. Could you please elaborate in details or if you know a link that provides details. Thanks again for your help. –  Maria Burton Sep 27 '13 at 18:51
    
Sorry, which part? Do you know how to create a search results page? Do you know how to edit the Core Results and Add an Additional Query Term? Do you know how to direct the Search box web part (or the site search properties) to a specific results page? Let me know which part. –  Matthew McDermott Sep 28 '13 at 11:30

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.