How to configure search results web part to display results only after a query is generated from user?

Hi All,
I am crawling documents from a file server. I created a new content source and crawled the documents. All documents are crawled successfully.
Then I went to my enterprise search center site collection and created a new result source. I have added the query to use above content source.
After that, on a page I am trying to configure the search results web part to display documents using this result source. Now the problem is:
It displays all the documents that are crawled without searching for anything. I mean first it should not display any results. If a user searches for something , then according to that search it should display results.
Any idea how to do this in the web part? I am using SharePoint 2013 on premise enterprise edition. No code. Totally OOTB.

Hi Mohan,
What did you use for the Query text in the result source?
I could reproduce this issue when I used Query text like: {searchTerms} Path:”http://sps2k13sp/sites/First/Shared%20Documents”
Then I changed the Query to
{?{searchTerms}
Path:"http://sps2k13sp/sites/First/Shared%20Documents"}
, then Search result web part didn’t return results without searching.
So , check your result source, and use the Query like the above(adding "{?...}").
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support

Similar Messages

  • Data view web part to display the most frequently accessed pages based on the user that is logged in

    I am working on a project in which I would like to display the top 5 most accessed pieces of content as links, based on the user that is logged in. Our MOSS 2007 implementation has subsites for all regions that we do business in, as an example North, South, East, and West. When a user visits the North region homepage, I would like a web part to display:
    Hello, <username>, here is a listing of your most accessed content:
    Link to One
    Link to Two
    Link to Three
    Link to Four
    Link to Five
    So each user would get a customized list based on their content access. We are not using my sites, but these would not work as we want the list to display on the home page of the region site.
    I am thinking that a data view may work here, but I am not sure. Any help is greatly appreciated.

    If you are running MOSS you may want to take a look at the Relevant Documents web part too.
    http://office.microsoft.com/en-us/sharepointserver/HA102410251033.aspx
    The Relevant Documents Web Part helps you create a personalized view of the documents that you create, check out, and change. In a large Document Center, the Web Part can save you time and effort by making files easier to find and use. The following figure shows the Web Part:

  • Content Search and 'Items Matching a Tag' Web Part Not Displaying Results Shown in Preview

    Hi
    I've been trying to set up both the Content Search and Items Matching a Tag Web Parts with the same issue.  In both cases I can create a query which displays the expected results in the Search Result Preview pane but no results are returned when browsing
    the page.
    I'm a Site Collection administrator
    tried viewing the page in IE8, Chrome and Firefox
    another user account with Full Control permissions on the site results in the same issue
    I've reindexed the site (which has completed as other alterations on the content are now being returned in the normal search results)
    I've tried removing and re-adding the offending web parts
    The queries in both web parts are pushed back to the most simple possible - ie all documents in the current site collection for the Content Search query and 'Current site collection + Don't restrict by any tag' in the Items Matching a Tag
    I haven't touched the display templates or made any other alterations AT ALL - this is a virgin site collection beyond documents in a library
    Does anyone have any ideas?

    I was able to make this do what I needed it to.

  • How do I get a web part to display items from a dropdownlist?

    I have a DropDownList that am filling with items from a list. The part of my code that am using to read the list and populating the drop down works just fine. I am now trying to figure out how to display the contents of the drop down on a web part. I know
    it sounds like a straight forward and easy thing to figure out, but I have blanked out. Does anyone have a snippet I can take a look at? This is how I am currently reading from a list to create the drop down...
    protected override void CreateChildControls()
    string title = string.Empty;
    EditorChoices = new DropDownList();
    string siteUrl = "mySite";
    using (SPSite site = new SPSite(siteUrl))
    SPWeb web = site.RootWeb;
    SPList list = web.Lists["testList"];
    SPQuery testQuery = new SPQuery();
    testQuery.Query = "<Query><Where><Geq><FieldRef Name='Title'/>" +
    "<Value Type='Number'>10</Value></Geq></Where></Query>";
    foreach (SPListItem item in list.GetItems(testQuery))
    title = Convert.ToString(item["Title"]);
    EditorChoices.Items.Add(title);
    Controls.Add(EditorChoices);
    base.CreateChildControls();
    ChildControlsCreated = true;
    I basically want to display the items returned from the query, which are now in the dropdownlist, to be displayed on my custom webpart. I really appreciate the help.
    Thanks
    UPDATE: My dropdownlist is a web part property. So when editing the web part, the drop down control appears in the web part property. Now that part is working just fine. The part am having an issue with is, the second part of my requirement is that I want
    to display that same information within the drop down on the web part. Not as another drop down, but just to display them as a vertical text list on the web part.

    Hello,
    >I want to be able to display all the entteries in the dropdown,
    Could you please provide more information? as per your description fisrt part is done, which was filling data in dropdown list. So what is next?
    If you want to get selected value from dropdown or filter value then you may try this link:
    http://bilbrobloggins.com/sharepoint/dropdown-list-box-filter-web-part-in-sharepoint-ndash-part-three/
    http://tmullenssharepoint.wordpress.com/2013/04/12/sharepoint-custom-web-part-properties-from-sharepoint-list/
    Correct me if i misunderstood
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Results web part showing results before search query is typed in search box

    2 part question
    I am creating a wiki site in which the home page has a search box web part, and a results web part.  I have the search box configured to return the results to the results web part.  I created a result source and changed the query on the results
    web part to use this results source.  I am getting results from the library I am trying to, but...
    1) The results web part is showing results when the page is loaded before any query is typed into the search bar.  Why is this and can it be configured to just be blank until a query is entered into the search bar?
    2) Is it possible to have 1 search box and 1 results part have 2 different scope choices?  ie, 1 scope for the wiki library and 1 for a document library?
    Thank you.

    So I have to have 2 different search result web parts to have 2 different scopes if I wish to have the search and results occur on the same page? Would I also have to have 2 search boxes?
    Also, I am trying to figure out this issue where results are being returned without anything being entered in the search box.  I have {searchterms?} in my query, and documentation suggests this to be the way to handle this issue, but I continue to get
    results shown in the results web part without even entering a search query.  Please assist.

  • Search navigation web part question

    I try to configure search navigation and User Current Query from drop down always say target not found. I try to change to search results web part ,but it is not working. It set back to target not found.

    Hi,
    According to your description, my understanding is that you cannot change the User Current Query from in the Search Navigation web part.
    I recommend to delete all the search result web parts in the result page and then add a new search result web part, then change the User Current Query from in the Search Navigation web part.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Search results web part error, missing tabs.

    Hello,
    I have a custom master page built from an html on Sharepoint Online.
    I want to add a Search Results webpart on my page, but when I do it, I see that this webparts has missing options. I only have the first two, and are not even complete, I cannot swith between basic and advance query and I don't have the refinement, sorting,
    test tabs..
    Opening the developer tools for the popup, I see the following error.
    Uncaught TypeError: Cannot read property 'add_resultRendered' of undefined on Search.configuration.js on line number 1.
    The point is, that if I quit my masterpage and I put the seattle, the webparts works perfect. So I know that there is something missing on my masterpage, but I don't have a idea about what can be.
    Any thoughts?
    Many thanks,

    Hi arcanedevice,
    According to your description, my understanding is that the Search Result Web Part was not showing data for Anonymous Users.
    The cause of this issues was due to security trimming. For resolving this issue, please do the followings:
    Under the SharePoint Site go to Site Settings.  Search -> Search and offline availability -> Indexing ASPX Page Content, Enable the option "Always index all Web Parts on this site"
    Under Search Service Application, do a Full Crawl for the content source
    More information, please refer to the link:
    http://blogs.msdn.com/b/sowmyancs/archive/2010/07/16/sharepoint-2010-search-not-showing-any-results-for-anonymous-users.aspx
    After the above, compare the result. If this issue still exists, please run the following PowerShell Script:
    $web = get-spweb "http://yoursiteurl/subweb/subsubweb"
    $list = $web.Lists["ListName"]
    $list.BreakRoleInheritance($true)
    $list.AnonymousPermMask = $list.AnonymousPermMask -bor ([int][Microsoft.SharePoint.SPBasePermissions]::ViewFormPages) #binary or adding the permissions
    $list.Update()
    More information, How to Make List Items Visible to Anonymous Users (in Search)
    http://soerennielsen.wordpress.com/2012/05/29/how-to-make-list-items-visible-to-anonymous-users-in-search/
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Adding Description or Content Preview to Search Result Web Part

    Hello,
    I am on Sharepoint Online 2013 working on an enterprise wiki site. I've added a search result web part and configured a query to return the results I want. The
    Results Control Display Template is set to Default and the
    Result type for item is set to Sharepoint Wiki.
    Is there a way to
    1) Customize the item display template to add in a description value, or show the first 'x' number of characters from the content?
    2) Customize the hover display to show only the body content (instead of complete page), or increase the zoom level where the content area is shown larger?
    Any help would be greatly appreciated.
    I had images to attach but will have to attach them later as I cannot until my account is verified.

    Hi
    Check this
    http://blogs.technet.com/b/tothesharepoint/archive/2013/09/05/understand-how-item-display-templates-and-hit-highlighting-work-in-sharepoint-server-2013.aspx
    http://blogs.technet.com/b/tothesharepoint/archive/2013/09/17/how-to-display-values-from-custom-managed-properties-in-the-hover-panel-in-sharepoint-server-2013.aspx
    http://blogs.technet.com/b/tothesharepoint/archive/2013/09/03/how-to-change-the-way-search-results-are-displayed-in-sharepoint-server-2013.aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • 'People Search Core Result' web part with 'office' filter in Keyword Query is not returning results

    I have created a page with "People search core result" web part on SharePoint 2010.
    When I try to use the setting (A) or (C) as shown below, there is no results been returned but when set to setting (B), there are results been returned.
    In the returned results I can see the OfficeNumber field is been populated with values and some of them is "UK Finance".
    Setting (A)
    Result Query Options
    -- Fixed Keyword Query = contentclass:spspeople -- Append Text To Query = Department:"Finance" AND OfficeNumber:"UK Finance"
    Setting (B)
    Result Query Options
    --- Fixed Keyword Query = contentclass:spspeople --- Append Text To Query = Department:"Finance"
    Setting (C)
    Result Query Options
    --- Fixed Keyword Query = contentclass:spspeople --- Append Text To Query = OfficeNumber:"UK Finance"
    What am I doing wrong here? Am I missing something? Do I need any additional configuration in order to get this to work?
    I hope someone could help me or point me to the right direction.
    Thank you
    muges

    You might want to check the Manage User Properties area of the User Profile Service in Central Admin.
    Any properties you query on should be marked "Indexed" or "Use in Scopes".  You can also check that you are using the correct internal name for these properties.

  • Custom Search Results web part: show only sites wherein the current user has access

    Hi,
    I'm trying to create a custom Search Box and Search Results web part in one of my web application. The search result should show only sites wherein the current user only has an access. Do you have an idea how to implement this? Thanks. :)
    Regards,
    Napster

    Hi Napster,
    From my experience, we can only search the result which we have view permission at least.
    Please provide more information about your requirement if there is misunderstanding.
    More information about search result web part:
    http://technet.microsoft.com/en-in/library/gg549987(v=office.15).aspx
    Regards,
    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] .
    Rebecca Tu
    TechNet Community Support

  • Search Result Web Part - "Sorry, something went wrong " Unless users have edit rights.

    I have a SharePoint 2013 farm.  On content pages, we are using search result web parts.  If the user has edit rights, they work but if the user has only read rights there is a "Sorry, something went wrong." Error. 
    Thanks for your help in advance. 

    This is a pretty generic error in SharePoint that can be caused by any number of things. You can take a look a the Web Parts Maintenance Page by adding "?content=1" to the URL of your page. If you recently added a web part to the page or some other customization,
    this will allow you to turn it off.
    More than likely though, you will have to do some digging. Whenever you are in that page and get an error, you get a correlation id like in your example above. You can dig deep into the logs by finding them (typically in C:\program files\common files\microsoft
    shared\15\logs). Look for the most recent file and do a search it in and see if you can find that correlation id. If you can't find it you might try the previous log. When you find matching entries for the correlation id, you should get some idea to the component
    that is failing and causing your issues.

  • Content Search Web Part Has No Results

    Hello,
    I have been working on a site for a few weeks now and have been trying to make a simple Image Slider. I have found many tutorials and all are helpful -- except I get stuck at the same part every time. I am trying to use a Content Search Web Part in order
    to pull images from a library/list and display them. I go through almost the same instructions every time but my query never shows any results.
    I have went in to 'Change Query' and set the following:
    Select a query: Pictures (System)
    Restrict By App: Specify a URL --> Then changed to mysite/myimagelibrary
    I have tried a few things. I have changed the Result Source to multiple different things, including the default 'Recently Changed Items.' I have also tried to put the images in a list rather than a Picture Library. I have also tried MANY different ways of
    putting in the 'specific URL.'
    I don't know why I can't seem to get results from my query. Any help or suggestions would be appreciated. Thank you.

    Hi,According to your post, my understanding is that you used a Content Search Web part to search images from a library/list , it didn’t display any
    Results.
    Please check which content type you used for these images . Maybe its content type is document rather than picture. Please make sure your images’ content type is picture.
    You can go in to 'Change Query' and set the following:
    Select a query: Items matching a content type(System)
    Restrict by App: Current site
    Restrict by content type: Picture
    As you have mentioned in your description “Specify a URL --> Then changed to mysite/myimagelibrary”.
    Here is a similar issue, you can use as a reference:
    http://social.technet.microsoft.com/forums/sharepoint/en-US/4a683be5-354d-4497-88da-672dd6335358/content-by-search-web-part-shows-no-results
    If the issue still exists, please feel free to let me know.
    Best Regards,
    Lisa Chen

  • More than 5 query IDs in the search core results web part?

    I need to have six search results web parts on the same page, all using the FASTSearch location, but each with a separate Search Action Links web part to sort  it.  But there are only 5 cross-web part query IDs available.  Is it possible to
    extend the Search Core Results web part to have more than 5 queryIDs?
    David Tappan C/D/H Grand Rapids, MI

    Did you figure this out?

  • Search Results Web Part, Managed Navigation and Paging

    I am using managed navigation and have a search results web part that uses the Term.IdWithChildren as the query to filter the results by the selected navigation term. This works nicely until you need to us the paging. As soon as you go to the next page there are
    no results.
    It would appear that as soon as the URL has the #k=#s=11 added it looses the navigation term. This is a core part of the Sharepoint solution that I'm delivering and I cannot progress this any further and I'm going round in circles. I have another results
    page that has the search results webpart on but doesn't use the navigation term filtering and the paging works fine.
    As an alternative I was looking at writing my own search results web part, can I do this and render the sharepoint display templates somehow?
    Any help would be appreciated.
    Stuart

    Hi Stuart, 
    i suppose you may need to check your design regarding this custom coding, 
    as i know, when i tried previously, i didn't take any attention on the query result, so that it appear as no result. 
    please have a check this links, it helped me once, 
    http://technet.microsoft.com/en-us/library/gg549981.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/59e6e258-294d-44b2-996a-547e4e9f519d/customize-search-statistics-and-search-paging-web-parts
    http://kamilmka.wordpress.com/2012/04/14/customize-sharepoint-search-results-paging/http://blogs.msdn.com/b/sanjaynarang/archive/2009/02/20/handling-paging-and-total-results-count-in-sharepoint-custom-results-page.aspx
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Search Results web part - Custom Query using "Value with a parameter from URL" inconsistent

    I have encountered what I think may be a bug, but I am hoping that there is something that I am missing.
    Within my search site, I have created a new search results page where I want to customize the "Search Results" web part query.  I can add in any number of property and keyword filters (using the "Build Your Query" dialog) without
    issue... until I add a filter that uses the QueryString property (the builder dialog calls this "Value with a parameter from URL").
    If I use {QueryString.MyParameterX} for filtering, it works beautifully in the query builder dialog.  I see the expected results in the search results preview pane, but as soon as I apply the changes things become inconsistent. 
    If I close/reopen my browser and navigate to my page at http://myaddress/search/Pages/testresults.aspx?MyParameterX=test I see results.  If I then refresh the page, I get a "Nothing here matches your search" message.  I can then go to
    the same address but change one character to an uppercase character and get results.  Refreshing that same page again returns "Nothing here matches your search".  I can only get search results one time per uniquely cased URL without having
    to close/reopen my browser.  This behavior was seen on both Firefox and IE.
    Finally, I found that if I instead navigate to http://myaddress/search/testresults?MyParameterX=test, it always returns results.  This, unfortunately isn't the best solution for me... but it is a solution.
    Any insight that anyone can provide is greatly appreciated!  I would really like to be able to depend on this working in all logical cases (especially since the search center of other sites is set using the path all the way down to /Pages).
    Thanks!

    Hi, have you been able to solve this issue? I'm getting the same issue and I cant solve it (required CU is installed).
    Fabio

Maybe you are looking for