Quantcast
Channel: SharePoint 2010 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 13778

Core Results Webpart - How can i check if the user search query is null?

$
0
0

I'm trying to create a search page for a document library using the OOB Search Box, Advanced Search Box and Core Results webpart.  I'm using the 'Append Text to Query' option to specify the path to the documents to be searched but since adding this new search criteria the search automatically executes when the page is opened by the user.  I want the search results to remain blank until the user enters some text and clicks search.

Is there any way I can reference the 'k' URL parameter in the core results web part and check if it's null to try and prevent the search executing. 

For example, if I use path:lists/MyLibrary contentclass:STS_ListItem_DocumentLibrary the search returns all documents in that library when the page loads. 

Is there someting I can add to the path to ceheck if the k parameter is null?  I've tried k<>'' but that doesn't work (unsurprisingly).  I'm just trying to figure out if this is possible?


Viewing all articles
Browse latest Browse all 13778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>