How to extend OOTB Content Search WebPart in SharePoint Online/0365 programmatically ?

Hi All,
We have some requirements wherein we need to extend some of the properties of Content Search WebPart in SharePoint Online/0365 using javascript (I am using 0365 NAPA tools). We are looking to create an App Part which functions same as content search webpart.
To be specific I want to override "QueryText" property of CSWP (using javascript in NAPA tool).
Any help would be greatly apprieciated.
Thanks in advance,
Dhananjay.

If you're talking about affecting the CSWP within a host web from within an AppPart, then no it won't be possible as the AppPart runs within an iFrame.
Perhaps a better approach might be to run your searches within the AppPart using the REST interface for search. Chris O'Brien has a pretty good example of this on his blog..
http://www.sharepointnutsandbolts.com/2013/01/calling-sharepoint-search-using-rest-eg.html and I think Scott Hillier did a session at SPC which you should be able to find on Channel 9. (Just search for REST SEARCH API)
Paul.
Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and helps prevent the same questions being asked multiple times.

Similar Messages

  • What are the possibilities and limitation of using Out of the box content search webpart on SharePoint Online 2013/O365 ?

    Hi All,
    We are migrating from on-premise SharPoint 2010 to SharePoint online 2013.
    I have few questions below: 
    What are the possibilities and limitations of using Out of the box content search webpart?
    Also, how the cross site publishing will work in SharePoint online something with managed navigations and product catalog apporach? if it is not supported, then what are the alternatives to acheive the same?
    Appriciate any commnets/clarifications.Thanks in advance.
    Thanks,
    Dhananjay.

    Here are the possibilities of Content search webparts
    http://office.microsoft.com/en-in/office365-sharepoint-online-enterprise-help/configure-a-content-search-web-part-in-sharepoint-HA104119042.aspx
    http://office.microsoft.com/en-in/office365-sharepoint-online-enterprise-help/when-to-use-the-content-query-web-part-or-the-content-search-web-part-in-sharepoint-HA104206662.aspx
    Compare the strengths and limitations of the Web Parts
    It’s important that you understand the strengths and limitations of the two Web Parts because if you choose the wrong one, your site could run into performance problems. You can use both Web Parts to show content that is based on a query. In a simplified
    world, here’s how you can decide between the two:
    Use the CQWP when you have a limited amount of content, your query is simple, and you don’t expect your content to grow much in the future.
    Use the CSWP in all other scenarios when you want to show content that is based on a query.
    The table below gives a comparison of the two Web Parts:
    Web Part behavior
    Content Query Web Part
    Content Search Web Part
    Query configuration
    Easy
    You’ll need to know about certain search features such as
    managed properties.
    Query across large amounts of content
    Limited
    Yes
    Handle complex queries
    Limited
    Yes
    Scale to handle future content growth
    Limited
    Yes
    Display content from other site collections
    No
    Yes (see
    section below)
    Design of query results can be customized
    Yes, by using XSLT.
    Yes, by using HTML.
    Maintenance cost in a complex site architecture
    High
    Small (see
    section below)
    Narrow down the query results that are displayed in the Web Part
    No
    Yes, in combination with the
    Refinement Web Part.
    It was not there previously but then it was added to Office 365
    http://blogs.office.com/2013/10/29/search-innovations-for-site-and-portal-design-in-sharepoint-online/
    If this helped you resolve your issue, please mark it Answered

  • Content search webpart in sharepoint 2013 paging is not not working for anonymous users on IE9, IE10 and Firefox

    Dear All,
     Issue in CQWP paging on IE9, IE10 and Firefox
    We have created CQWP in SharePoint 2013 for images rollup and its paging perfectly working for authenticated users on all browsers but it’s not working on public facing site for specific browser
     while we are trying to click on paging getting 
    something went wrong and correlation  with correlation id
    We did log analysis and getting different kind of problem description on every click some time contents authentications error, sometime memory
    Once I put webpart inside the  <!--MS:<ZoneTemplate>--> its completely stop working
      so we placed webpart outside  <!--MS:<ZoneTemplate>--> currently
    Strange point is its working on IE11. Please help us its highly appreciated
    Code Details :
    <div data-name="WebPartZone">
    <!--CS: Start Web Part Zone Snippet-->
    <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
    <div xmlns:ie="ie">
    <!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="x5d2d1828b2b44612974f72caded2bcd3" FrameType="TitleBarOnly" Orientation="Vertical">-->
    <!--MS:<ZoneTemplate>-->
    <!--ME:</ZoneTemplate>-->
    <!--ME:</WebPartPages:WebPartZone>-->
    </div>
    <!--CE: End Web Part Zone Snippet-->
    <!--CS: Start Content Search Snippet-->
    <!--SPM:<%@Register Tagprefix="spsswc" 
    Namespace="Microsoft.Office.Server.Search.WebControls" Assembly="Microsoft.Office.Server.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>-->
    <!--SPM:<%@Register Tagprefix="a2e8ead9d" 
    Namespace="Microsoft.Office.Server.Search.WebControls" Assembly="Microsoft.Office.Server.Search, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>-->
                            <!--MS:<spsswc:ContentBySearchWebPart runat="server" AlwaysRenderOnServer="False"
    ResultType="" NumberOfItems="12" DataProviderJSON="{&#34;QueryGroupName&#34;:&#34;Default&#34;,&#34;QueryPropertiesTemplateUrl&#34;:&#34;sitesearch://webroot&#34;,&#34;IgnoreQueryPropertiesTemplateUrl&#34;:false,&#34;SourceID&#34;:&#34;8413cd39-2156-4e00-b54d-11efd9abdb89&#34;,&#34;SourceName&#34;:&#34;Local
    SharePoint Results&#34;,&#34;SourceLevel&#34;:&#34;Ssa&#34;,&#34;CollapseSpecification&#34;:&#34;&#34;,&#34;QueryTemplate&#34;:&#34;path:\&#34;http://thepubauth.viacom.com/sites/vh1press/Shows/Show assets\&#34;
    PictureURL:\&#34;/sites/vh1press/Shows/Show assets/{Page.ID}/\&#34; (ContentTypeId:0x0101009148F5A04DDD49cbA7127AADA5FB792B00AADE34325A8B49cdA8BB4DB53328F214* OR ContentTypeId:0x010102*)&#34;,&#34;FallbackSort&#34;:[{&#34;p&#34;:&#34;LastModifiedTime&#34;,&#34;d&#34;:1},{&#34;p&#34;:&#34;Title&#34;,&#34;d&#34;:0}],&#34;FallbackSortJson&#34;:&#34;[{\&#34;p\&#34;:\&#34;LastModifiedTime\&#34;,\&#34;d\&#34;:1},{\&#34;p\&#34;:\&#34;Title\&#34;,\&#34;d\&#34;:0}]&#34;,&#34;RankRules&#34;:null,&#34;RankRulesJson&#34;:&#34;null&#34;,&#34;AsynchronousResultRetrieval&#34;:false,&#34;SendContentBeforeQuery&#34;:true,&#34;BatchClientQuery&#34;:true,&#34;FallbackLanguage&#34;:-1,&#34;FallbackRankingModelID&#34;:&#34;&#34;,&#34;EnableStemming&#34;:true,&#34;EnablePhonetic&#34;:false,&#34;EnableNicknames&#34;:false,&#34;EnableInterleaving&#34;:false,&#34;EnableQueryRules&#34;:true,&#34;EnableOrderingHitHighlightedProperty&#34;:false,&#34;HitHighlightedMultivaluePropertyLimit&#34;:-1,&#34;IgnoreContextualScope&#34;:true,&#34;ScopeResultsToCurrentSite&#34;:false,&#34;TrimDuplicates&#34;:false,&#34;Properties&#34;:{&#34;TryCache&#34;:true,&#34;Scope&#34;:&#34;{Site.URL}&#34;,&#34;ListId&#34;:&#34;00000000-0000-0000-0000-000000000000&#34;,&#34;UpdateLinksForCatalogItems&#34;:true,&#34;EnableStacking&#34;:true},&#34;PropertiesJson&#34;:&#34;{\&#34;TryCache\&#34;:true,\&#34;Scope\&#34;:\&#34;{Site.URL}\&#34;,\&#34;ListId\&#34;:\&#34;00000000-0000-0000-0000-000000000000\&#34;,\&#34;UpdateLinksForCatalogItems\&#34;:true,\&#34;EnableStacking\&#34;:true}&#34;,&#34;ClientType&#34;:&#34;ContentSearchRegular&#34;,&#34;UpdateAjaxNavigate&#34;:true,&#34;SummaryLength&#34;:180,&#34;DesiredSnippetLength&#34;:90,&#34;PersonalizedQuery&#34;:false,&#34;FallbackRefinementFilters&#34;:null,&#34;IgnoreStaleServerQuery&#34;:false,&#34;RenderTemplateId&#34;:&#34;DefaultDataProvider&#34;,&#34;AlternateErrorMessage&#34;:null,&#34;Title&#34;:&#34;&#34;}"
    BypassResultTypes="True" ItemTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/DT_Images.js" GroupTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Group_Content.js"
    ResultsPerPage="9" SelectedPropertiesJson="[&#34;PublishingImage&#34;,&#34;PictureURL&#34;,&#34;PictureThumbnailURL&#34;,&#34;Path&#34;,&#34;Title&#34;,&#34;Description&#34;,&#34;SecondaryFileExtension&#34;,&#34;ContentTypeId&#34;]"
    HitHighlightedPropertiesJson="[&#34;Title&#34;,&#34;Path&#34;,&#34;Author&#34;,&#34;SectionNames&#34;,&#34;SiteDescription&#34;]" AvailableSortsJson="null" ShowBestBets="False" ShowPersonalFavorites="False"
    ShowDefinitions="False" ShowDidYouMean="False" PreloadedItemTemplateIdsJson="null" QueryGroupName="Default" RenderTemplateId="~sitecollection/_catalogs/masterpage/Display Templates/Content Web Parts/Control_ListWithPaging.js"
    StatesJson="{}" ServerIncludeScriptsJson="null" Title="Content Search" FrameType="None" SuppressWebPartChrome="False" Description="&#60;%$Resources:Microsoft.Office.Server.Search,CBS_Description;%&#62;"
    IsIncluded="True" ZoneID="ImportedPartZone" PartOrder="0" FrameState="Normal" AllowRemove="True" AllowZoneChange="True" AllowMinimize="True" AllowConnect="True" AllowEdit="True"
    AllowHide="True" IsVisible="True" DetailLink="" HelpLink="" HelpMode="Modeless" Dir="Default" PartImageSmall="" MissingAssembly="&#60;%$Resources:core,ImportErrorMessage;%&#62;"
    ImportErrorMessage="&#60;%$Resources:core,ImportErrorMessage;%&#62;" PartImageLarge="" IsIncludedFilter="" ExportControlledProperties="True" ConnectionID="00000000-0000-0000-0000-000000000000" ID="g_9f61c988_228e_4f91_8d67_04314f144f48"
    ChromeType="None" ExportMode="All" __MarkupType="vsattributemarkup" __WebPartId="{9f61c988-228e-4f91-8d67-04314f144f48}" WebPart="true" Height="" Width="">-->
    <!--ME:</spsswc:ContentBySearchWebPart>-->
    <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div ms-webpart-chrome-fullWidth "><div webpartid="00000000-0000-0000-0000-000000000000" haspers="true" id="WebPartWPQ1" width="100%" noindex
    " onlyformepart="true" allowdelete="false" ><div style="display: none;"></div><div componentid="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_csr"
    id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_csr" style="display: none;"></div><noscript>&lt;div id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_noscript"&gt;It
    looks like your browser does not have JavaScript enabled. Please turn on JavaScript and try again.&lt;/div&gt;</noscript><div id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48"><div><div
    id="WebPartWPQ2_ChromeTitle"><span title="" id="WebPartTitleWPQ2"><h2 style="text-align:justify;"><nobr><span></span><span id="WebPartCaptionWPQ2"></span></nobr></h2></span></div><div
    webpartid="00000000-0000-0000-0000-000000000000" haspers="true" id="WebPartWPQ2" width="100%" ms-WPBorder noindex ms-wpContentDivSpace " onlyformepart="true" allowdelete="false" ><div componentid="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_ctl00_csr"
    id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_ctl00_csr"><div id="DataProvider" name="Control"></div></div><noscript>&lt;div id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_ctl00_noscript"&gt;It
    looks like your browser does not have JavaScript enabled. Please turn on JavaScript and try again.&lt;/div&gt;</noscript><div id="ctl00_ctl00_PlaceHolderMain_ComponentMain_ComponentPropertyGrids_g_9f61c988_228e_4f91_8d67_04314f144f48_ctl00"></div><div></div></div></div></div><div></div></div></div><!--PE:
    End of READ-ONLY PREVIEW-->
    <!--CE: End Content Search Snippet-->
          </div>

    Hi,
    In the “Property Mappings” of the Content Search Web Part, we can see that the Picture field will only display the value retrieved from “PublishingImage;PictureURL;PictureThumbnailURL”,
    because there is corresponding column in OOTB Document Library holds the valid value of a thumbnail image for a document, that’s why documents from Document Library display no thumbnail image in a Content Search Web part.
    If you want to display thumbnail images for documents of Document Library, you can add a custom Picture column to hold the thumbnail image of a document, set the “Property
    Mappings” to display this custom Picture column.
    By doing this, every time uploading a document to this library, setting a thumbnail image(provided by common users, not generated by SharePoint automatically) for
    that custom Picture column, in the Content Search Web Part, the thumbnail image will display.
    Thanks
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to show catalog items with Approval Status:Pending in a Content Search Webpart

    How to show catalog items with Approval Status:Pending in a Content Search Webpart using cross site publishing. Thanks in advance.

    I don't think you're going to be able to. Usually Approval Status is used in conjunction with Major/Minor versioning and while Approval Status is pending the item is usually a draft.
    As a result the search crawler should not be able to see the draft items as it would not have the necessary rights to do so. (Good practice ensures that the Search Crawler has only read access and is not an elevated account for this reason)
    Paul.
    Please ensure that you mark a question as Answered once you receive a satisfactory response. This helps people in future when searching and helps prevent the same questions being asked multiple times.

  • How to display Column of a particular list to page using Content Search Webpart?

    Hi,
    I am having two columns 'Column1 & Column2' in a list names Demo. I need to display the items of both the columns into a page with the help of Content Search Webpart. I am using SharePoint 2013 Platform.
    Expecting some useful comments on the same...!!
    Warm Regards,
    Tony Joy.

    Hi,
    If you just want to display two columns of a list, Content Query Web Part will be more appropriate:
    http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/05/10/how-to-use-the-content-query-web-part-to-rollup-data-in-sharepoint-2013.aspx
    To display multiple columns, here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/1484df2b-0fb9-4b58-b833-a75019db88c7/content-query-display-multiple-columns
    Best regards
    Patrick Liang
    TechNet Community Support

  • Hide / Remove Content Search Webpart when no results returned

    Hi SharePoint friends
    I'm looking to find a way to hide the whole Content Search webpart (including the webpart title and border area) if there are no results coming back from the query.
    What I tried
    1. There is this property: "ShouldHideControlWhenEmpty" but it doesn't do anything when there are no results. The webpart is still visible. Webpart has a the Title and the Border around it so when
    there are no results the title and the border show up with no results. Like I said I want to hide the whole thing in that case.
    2. Wrote a jQuery script that searches for the text "There are no results" message (which comes from the webpart when there are no results) and hides the webpart. However, there is a short flicker once the page loads because the webpart first gets
    rendered for a split second and then disappears by virtue of my jQuery script - which is not great UI experience.
    3. So I thought I could extend the OOTB ContentBySearchWebPart and get a hold of some kind property that would get me the result count. If the results count is 0 simply I would hide the webpart server side. I looked
    at the documentation online - nothing I could find that I could leverage.
    Help? Thanks!

    Hi,
    To hide the whole Content Search Web Part when there is no result returned, a workaround can be like this:
    In the “Web Part Properties” panel, set checked the “Don't show anything when there are no results”, set the Chrome Type as “None”:
    By doing this, the whole web part will disappear when there is no result returned.
    Thanks
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • Use Navigation Node Title of Term Store in a Content Search webpart

    Hi,
    Do you have an idea on how to use the Navigation Node Title of a Term in Term Store to a Content Search webpart? I can now get the value of the Term itself, but I need is the Navigation Node Title of that term. I'm using managed properties. Thanks in advance. 
    Regards,
    Napster

    Take a look at this article that explains all the variables available while writitng search queries.  There is a whole section on managed metadata navigation terms.
    http://technet.microsoft.com/en-us/library/jj683123(v=office.15).aspx
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Content Search Webpart Query (urltoken to list metadata column)

    Im developing a internet site using Cross site publishing.
    In the publishing site collection, on a category page, Im trying to query the relevant contents
    on a catalog list using urltoken to metadata column on a list using Content search webpart.
    I have created list of departments in the metadata and same is used as part of managed navigation.
    Metadata term : New department
    friendly url : New-department
    When I query the Catalog's metadata column (department column) using the urltoken.1 (new-department) it is not fetching the results
    since the value is New department (space between two words)
    Any help on how to query correctly.

    Hi Ramamor,
    Thanks for posting your issue, Kindly browse below mentioned URLs to configure the query in a content search web part for content Metadata step by step
    http://blogs.technet.com/b/tothesharepoint/archive/2013/03/07/stage-5-connect-your-publishing-site-to-a-catalog.aspx
    http://blogs.technet.com/b/tothesharepoint/archive/2013/05/23/stage-10-configure-the-query-in-a-content-search-web-part-on-a-catalog-item-page.aspx
    http://sp2013.blogspot.in/2012/08/content-search-and-metadata-driven.html
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Custom Display template for Content Search webpart

    Hi,
    I am trying to customize the out of the box "slideshow" display template for content search webpart which renders Images.
    By default, the slideshow display template has a fixed the image size which is very small. Is it possible to increase the dimensions of the container or control template to show a much larger image size?
    Can anyone please help on how to do this?
    Thanks,

    Hi,
    According to your description, my understanding is that you want to increase the dimensions of the container or control template to show a much larger image size in the Content Search web part.
    I recommend to create a custom Display Template (control and Item display templates) and use JQuery Slider plugin to achieve this goal.
    More detailed information are provided in the link below:
    http://blogs.technet.com/b/sharepoint_quick_reads/archive/2013/08/02/sharepoint-2013-customize-display-template-for-content-by-search-web-part-cswp-part-2.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Content search webpart query

    Hi ,
    I am to trying to add a property filter to a content search webpart.I have to query the property with the page title of the current page.So assuming my page url ends with "/Pages/b1.aspx".I want to query by b1. I see that there is "value of
    a token from url" option available in the drop down but I cannot make out how I can parse out the page title("b1" in the example).
    Thanks in advance,

    Hi  ,
    When you select Value of a token from URL,   the query text will add {URLToken.1} by default.  {URLToken.1} represents a value from the URL of the current page.  The integer, in this case
    1, represents the value in the URL as counted from right to left. So, for example, the current page URL where the content  search web part is added in : http://www.contoso.com/SitePages/Home.aspx, the query variable {URLToken.1} represents the value Home.aspx.
    For query variable {URLToken.2}, it represents the value SitePages .
    This means  only if the current page where the content search web part is added in  is  bi.aspx, you can add {URLToken.1} and filter all results whose URL contains bi.aspx in the last.
    For achieving your demand, you can create a new content source with the URLs you want .
    http://technet.microsoft.com/en-us/library/jj219808(v=office.15).aspx
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Building Query for SharePoint content Search Webpart

    Hi,
    There is a content search webpart being used for displaying the Related Items from a Page library. Whenever a new item/Page is added into the Page library, there is a column that accepts multiple values.
    Now my requirement is, when a new page is added (which would be a part of custom page layout which has Search webpart) with a Column named say for Ex: 'Status' values as New, Old, Newer and when this page is opened, I want the search web part to display
    all other items/pages whose 'Status' column values would have one among these.
    As I do not have any idea on building the query with this webpart, any help/suggestions would be greatly appreciated.

    Dipti,
    How about replacing you line as below (with content class)
    var newQuery = 'ContentTypeId:0x0102*'+ ' ' +'EndDate'+ '>=' + date;
    with
    var newQuery = 'contentclass:STS_ListItem_Events'+ ' ' +'EndDate'+ '>=' + date;
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Content search webpart query is not rendering result as per the expectation !!

    Hello,
    I have 5 Content search web part on same page with different display templates.
    1) Search Aggregated Result - This display search results for announcements,discussion and wiki as per the current user.
    2) My websites - Thsi displays site links as per the current user.
    3) My Tasks - This display task items as per the current user
    4) Daily calendar - This display the results as per the date selection in calendar control.
    For Daily calendar - I have specified calendar control in custom display template to filter search results based on date selection which is working as below:
    I have got the reference from following link that changing the query dynamically to filter search result data - 
    http://sharepointificate.blogspot.in/2014/08/content-search-webpart-dynamic-filtering.html
    ctx.OnPostRender = [];
    ctx.OnPostRender.push(ctx,function(){
    $('<div id="trCalendar" class=""></div>').insertBefore('#idCalender')
    $(document).ready(function () {
    $("#trCalendar").datepicker( {
    onSelect: function(date) {
    var groups = Srch.ScriptApplicationManager.get_current().queryGroups;
    $.each(groups, function () {
    // Look for query groups associated with a CSWP
    if (this.displays != null && this.displays.length > 0) {
    if (this.displays[0] instanceof Srch.Result) {
    // Update and execute query
    var newQuery = 'ContentTypeId:0x0102*'+ ' ' +'EndDate'+ '>=' + date;
    this.dataProvider.set_queryTemplate(newQuery);
    this.dataProvider.issueQuery();
    selectWeek: true,
    However, this date query is being applied for every search result web part mentioned in page.
    How can I make it work only for the Daily Calendar web part ?
    Your answer will be much appreciated.
    Thanks and Regards,
    Dipti Chhatrapati

    Dipti,
    How about replacing you line as below (with content class)
    var newQuery = 'ContentTypeId:0x0102*'+ ' ' +'EndDate'+ '>=' + date;
    with
    var newQuery = 'contentclass:STS_ListItem_Events'+ ' ' +'EndDate'+ '>=' + date;
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Create document preview in sharepoint 2013 content search webpart slideshow

    I want to show preview of documents(word,excel,ppt or videos) in the content search webpart slideshow view. By default we can show images from picture library in the content search webpart slide show view. But i need to show preview of documents(like search
    results document preview) in the help me to content search webpart slider. 
    Please help me to solve this issue!
    Thanks in advance!
    SangeethaAjith

    Hi, Thanks for your reply. Actually m working with Sharepoint Online 2013. I need to show the doc preview
    in content search webpart slideshow. If u have any idea pls let me know.
    The content search webpart is fetching documents using query and we didnt know what results are going to come. For the result documents i need to show the preview.

  • Choose display template based on result type - Content search webpart

    Hi 
    Is it possible to choose display template based on result type in content search webpart same like search results web part? If not available can it be achieved programmatically?
    The content search web part is queried against document content type. Based on the document type, the document has to be seen in the hover template.
    Please advise.

    Hi,
    From your description, my understanding is that you want to choose display template based on result type as search result Webpart in Content Search Webpart.
    You could customize your display template for Content Search Web Part, please refer to this article:
    http://www.benprins.net/2014/05/21/sharepoint-2013-custom-display-template-for-content-by-search-web-part/
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to extend  breadth first Search for Binary Tree to any kind of Tree??

    Dear Friends,
    I am thinking a problem, How to extend breadth first Search for Binary Tree to any kind of Tree?? ie each node has more than 2 leaves such as 1, 2,3,4 or any,
    I have following code to successfully apply for breadth first Search in Binary Tree as follows,
    package a.border;
    import java.util.ArrayList;
    import java.util.LinkedList;
    public class Tree
        int root;
        Tree left;
        Tree right;
        static ArrayList<Integer> list = new ArrayList<Integer>();
        static ArrayList<Tree> treeList = new ArrayList<Tree>();
        private static LinkedList<Tree> queue = new LinkedList<Tree>();
         * @param root root value
         * @param left left node
         * @param right right node
        public Tree(int root, Tree left, Tree right)
            this.root = root;
            this.left = left;
            this.right = right;
        /** Creates a new instance of Tree
         * You really should know what this does...
         * @param root
        public Tree(int root)
            this.root = root;
            this.left = null;
            this.right = null;
         * Simply runs a basic left then right traversal.
        public void basicTraversal()
            //Check if we can go left
            if (left != null)
                left.basicTraversal();
            //Add the root
            list.add(root);
            //Check if we can go right
            if (right != null)
                right.basicTraversal();
        public ArrayList<Integer> getBreadthTraversal(ArrayList<Integer> list)
            //Add the root to the arraylist, we know it is always the first entry.
            list.add(root);
            //Basically we add the first set of nodes into the queue for
            //traversing.
            //Query if left exists
            if (left != null)
                //Then add the node into the tree for traversing later
                queue.add(left);
            //Same for right
            if (right != null)
                queue.add(right);
            //Then we call the traverse method to do the rest of the work
            return traverse(list);
        private ArrayList<Integer> traverse(ArrayList<Integer> list)
            //Keep traversing until we run out of people
            while (!queue.isEmpty())
                Tree p = queue.remove();
                //Check if it has any subnodes
                if (p.left != null)
                    //Add the subnode to the back of the queue
                    queue.add(p.left);
                //Same for left
                if (p.right != null)
                    //Same here, no queue jumping!
                    queue.add(p.right);
                //Append to the ArrayList
                list.add(p.root);
            //And return
            return list;
         * Makes a tree and runs some operations
         * @param args
        public static void main(String[] args)
             *                             4
             *          t =           2       6
             *                      1   3    5   7
            Tree leaf6 = new Tree(1);
            Tree leaf7 = new Tree(3);
            Tree leaf8 = new Tree(5);
            Tree leaf9 = new Tree(7);
            Tree t4 = new Tree(2, leaf6, leaf7);
            Tree t5 = new Tree(6, leaf8, leaf9);
            Tree t = new Tree(4, t4, t5);
            t.basicTraversal();
            System.out.println("Here is basicTraversal ="+list.toString());
            list.clear();
            t.getBreadthTraversal(list);
            System.out.println("getBreadthTraversal= " +list.toString());
            list.clear();
        }Can Guru help how to update to any kind of tree??
    here this code is for the tree like:
             *                             4
             *          t =           2       6
             *                      1   3    5   7
             */But i hope the new code can handle tree like:
             *                             4
             *                           /   | \
             *                          /     |   \
             *          t =            2     8   6
             *                        / |  \    |    /| \
             *                      1 11  3 9   5 10  7
             */Thanks

    sunnymanman wrote:
    Dear Friends,
    I am thinking a problem, How to extend breadth first Search for Binary Tree to any kind of Tree?? ...The answer is interfaces.
    What do all trees have in common? And what do all nodes in trees have in common?
    At least these things:
    interface Tree<T> {
        Node<T> getRoot();
    interface Node<T> {
        T getData();
        List<Node<T>> getChildren();
    }Now write concrete classes implementing these interfaces. Let's start with a binary tree (nodes should have comparable items) and an n-tree:
    class BinaryTree<T extends Comparable<T>> implements Tree<T> {
        protected BTNode<T> root;
        public Node<T> getRoot() {
            return root;
    class BTNode<T> implements Node<T> {
        private T data;
        private Node<T> left, right;
        public List<Node<T>> getChildren() {
            List<Node<T>> children = new ArrayList<Node<T>>();
            children.add(left);
            children.add(right);
            return children;
        public T getData() {
            return data;
    class NTree<T> implements Tree<T> {
        private NTNode<T> root;
        public Node<T> getRoot() {
            return root;
    class NTNode<T> implements Node<T> {
        private T data;
        private List<Node<T>> children;
        public List<Node<T>> getChildren() {
            return children;
        public T getData() {
            return data;
    }Now with these classes, you can wite a more generic traversal class. Of course, every traversal class (breath first, depth first) will also have something in common: they return a "path" of nodes (if the 'goal' node/data is found). So, you can write an interface like this:
    interface Traverser<T> {
        List<Node<T>> traverse(T goal, Tree<T> tree);
    }And finally write an implementation for it:
    class BreathFirst<T> implements Traverser<T> {
        public List<Node<T>> traverse(T goal, Tree<T> tree) {
            Node<T> start = tree.getRoot();
            List<Node<T>> children = start.getChildren();
            // your algorithm here
            return null; // return your traversal
    }... which can be used to traverse any tree! Here's a small demo of how to use it:
    public class Test {
        public static void main(String[] args) {
            Tree<Integer> binTree = new BinaryTree<Integer>();
            // populate your binTree
            Tree<Integer> nTree = new NTree<Integer>();
            // populate your nTree
            Traverser<Integer> bfTraverser = new BreathFirst<Integer>();
            // Look for integer 6 in binTree
            System.out.println("bTree bfTraversal -> "+bfTraverser.traverse(6, binTree));
            // Look for integer 6 in nTree
            System.out.println("bTree bfTraversal -> "+bfTraverser.traverse(6, nTree));
    }Good luck!

Maybe you are looking for

  • Create a jar file using the jar tool

    Hello all, can somebody help me with this situation: I use the following comand jar cfm Seti.jar manifest.mf SetiSeti.jar is the name of the file I want to create and Seti is the name of the folder where I have the class files, the manifest file and

  • Sorting Question iTunes 11

    This may be a bug, this may be me doing something incorrect. I have a CD that is a compilation of music from the 80s.  I want to have it come up in iTunes as a single album in Album view, but when I look at Artist view, I would like the songs to be l

  • RV220W PPTP Start IP Address must not be in the subnet of LAN:192.168.1.1/255.255.255.0

    Hello, I start setup of new RV220W Wireless router. I want to provide access to internal network via PPTP. But gettting error 'PPTP Start IP Address must not be in the subnet of LAN:192.168.1.1/255.255.255.0'. I reviewed the forum and some user's say

  • Compare byte to null?

    I need to compare a byte to a null value for a program I am writing, in order to catch these values to stop them being printed in an output file as "<nul>". At first, I tried       for (int i=1; i<=127; i++)      if (AwaitData.received[i] == null)but

  • N72 vista drivers

    my n72 is not installing on my vista operating system, where i can get vista drives for n72