Setting the Search Scope for Sharepoint Site Collection - search

This is really strange. I have 2 SP Web Applications. One at Port 80 and one at Port 83.
They are both TeamSites with the Publishing Feature Activated. Both have a search box at the top right that allows me to specify the search scope.
The one at Port 80 allows me to select:
This Site: Home
All Sites
People
The one at Port 83 allows me to select:
This Site: Intranet
For both sites, i looked at:
http://share2003/_layouts/viewscopes.aspx?mode=site
http://share2003:83/_layouts/viewscopes.aspx?mode=site and
The settings are identical. I will like to enable the rest of the search scopes for the web application at Port 83.
Please advise.

I had a similar situation, where some of the site collections in my farm (1 WFE, 1 DB) contained all of the correct scopes ({This Site: , [This List: ], All Sites, People}), but others were missing "All Sites" and "People".
The site collections which were missing these Scopes also did NOT have the "Advanced Search" link to the right of the search box.
On all of the site collections where these scopes were available (and where the Advanced Search link was available), there was a sub-site (aka web) named something like "Search", and that sub-site was specified in the Site Collection settings -> Search Settings as the Search Center to use to show richer results (the first radio button option).
So on one of my site collections which was missing Scopes, I created a Search Center sub-site and set it as the custom search center (Site Collection settings -> Search Settings). After that, all scopes were available and "Advanced Search" is now shown.
Thanks to http://insidesharepoint.blogspot.com/2007/06/and-now-another-word-form-our.html , which helped put me on the right path.

Related

SharePoint 2013 Custom result page URL for search queries

I'm trying to redirect the search queries to a search center url. I've created the search center and I use the Search Settings to set a result page url (my search center results.aspx).
I've tried setting the custom page for site collection and leave the site setting on "Use the same results page as my parent". I've also tried setting the custom page url directly in the site setting. But still the search results is shown on the site's "osssearchresults.aspx" page.
Am I forgetting something? It's like sharepoint is ignoring those settings.
Have a look at the actual search box web part settings. There is a properties for Search box where you can choose to use the default or you can send queries to a custom results page URL.
See if that is where the issue is.
Try this link for further information > https://learn.microsoft.com/en-us/sharepoint/search-box-web-part

Sharepoint Search Results Scopes

Currently I have a search set up on our Sharepoint 2010 server. The search works fine on the first try however after one search (aka the results page) the scope is defaulted to "this site:search".
I would like to modify the scope options on this page however I cannot seem to locate where to do so?
I would like the same scopes to display on both my results page and original search page. In summary the problem is the search is set up as a separate site and when the results page is displayed the only scope option is this site which esentially has no content. So an added bonus would be to remove the this site option from the page.
For now anyways the search has to stay as a separate site.
Thanks in advance.
UPDATE
In order to allow for additional scopes in the results page you must go to the site settings (as admin) > Search Settings > Site Collection Search Center and Enable Custom Scopes
I still need to know how to default to all site or hide this site search.
I too had the similar issue,in order to solve go to site settings->search scopes and then click displaygroups->drop down serach for
Click on Drop down serach for,a form opens where you can define serach scopes and at the bottm you can set the defuat search scope.Hope this helps
Below are the steps I had to take:
I had to set the specific search page and edit the web part settings to make sure they do NOT "Use site dropdown mode" or "Use site level defaults".
Set the dropdown mode of that webpart to be "Show, do not include contextual scopes, and default to 's' URL parameter".
In the miscellaneous section set the target search results page url to the results page in my search center. IE (/Search/Pages/results.aspx) in my case.
Add a search box to the results page with the same drop down mode as in step 2 above. I suggest navigating to your empty results page and then site actions > edit. Add the web part as normal.
Make sure you have done the step above by going to (/_layouts/enhancedSearch.aspx ) and setting the url to your search center (/Search/Pages) in my case.
I had the same problem when I used the Basic Search Site template, but not when I used the Enterprise Search Site template, which allowed me to edit Web Parts on the search AND the results page to show the scope dropdown.
To remove "This Site" from the scope list, edit both search box Web Parts and choose "Show, do not include contextual scopes."
Also, you will need to enable Publishing Infrastructure feature on the site collection before you can create a search site using the Enterprise Search Site template.
I also changed the master page on the search site to minimal.master to improve the layout.

How to redirect root web site to site collection

I'm having quite a hard time figuring out this problem and I need your help. Here's the scenario:
I have a sharepoint 2010 web application on my port 80. This has 2 site collections, the root, and the /sites/official. My problem is: The root site is empty, but in the future it will be my something (I don't know what yet), but my other site collection is ready to go and I already have an Internet address for it.
What I want to do is configure everything in way that I can type http://contoso.com and get as response my sub-site (yes, its a kind of redirect)...
how can I do it? What and where should I configure it?
add content editor webpart on your root site collection and put this javascript in that webpart
<script type="text/javascript">
window.location = "http://contoso.com/sites/official"
</script>
Open IIS manager
Right click on your SharePoint website -> Properties
Go to tab Home Directory
Choose A redirection to a URL
fill the URL for redirection. for example: http://contoso.com/sites/official
Notes:
Make sure to check A Directory below URL entered to avoid redirect loop
Link to another thread might interest the reader - immediate redirect page in sharepoint
Screenshot:
Add alternate access mapping for the sub-site collection from the central administration.
Central Administration > Application Management > Web Applications > Configure alternate access mappings

Create user friendly alias for a sharepoint site

I have a test Sharepoint server running on a Windows 7 machine. The url is http://liu-t500-01 and i want to create a user friendly alias http://temp for it. i have added
127.0.0.1 temp
to my hosts file (an A/host entry) and i have also created an alternate access mapping in Central Administration
http://liu-t500-01 Default http://liu-t500-01
http://temp Intranet http://temp
However when i try http://temp in the browser the sharepoint site does not come up. This is probably a simple problem but has me scratching my head...what did i do wrong?
Changing the IIS binding only will cause errors. You need to modify the alternate access mappings in SharePoint. There are tons of good articles our there that tell what to do in detail.
Here is just one: http://technet.microsoft.com/en-us/sharepoint/Video/ff679917
Try adding a host header in IIS
In IIS click on your site
choose the Bindings action
Click Add
In the Host Name field enter "temp"
click OK

distinguish between sharepoint site collection and a site by looking at one

When I am looking at a Sharepoint site home page, how can I tell if it is a site collection or a site? I also have the admin permissions if that helps, but, as you can see, no administration knowledge. :-)
A site collection will be at the top level after your sites qualifier (by default, this is "sites").
So http://[server.domain]/sites/First is a site collection,
But http://[server.domain]/sites/First/Second is site within the site collection.
Another way (if you are a site collection administrator) is to go to the site settings for any site. If you see the 4th column on the right labeled "Site Collection Administration" then you are at the top of a site collection. If you see "Go to Top Level Settings" then you are in a subsite.
You can also get a full list of all site collections from the Central Administration -> Application -> Site Collection List
If you create an instance of an SPSite object by passing an URL into its constructor, the SharePoint API will create a valid object out of that.
Now, if you call OpenWeb() on that object, you will get an instance of the SPWeb object that your given URL refers to.
Then you can compare the SPSite.URL (url of the root web of that site) to SPWeb.Url (url of your web). If they are the same, you have an url of a site collection.
Your code will look something like this (I don't have Visual Studio with me at the moment, so this is just pseudo-code)
string sUrl = "http://someserver/zeiten/mysite1/someweb";
Using (SPSite oSite = new SPSite(sUrl)){
Using (SPWeb oWeb = oSite.OpenWeb()){
if (oWeb.Url == oSite.Url) {
//sUrl refers to a site collection
} else{
//you actually have an url of some sub-web
}
}
}
See responses to a similar question of mine:
Finding SharePoint list item by its display form's URL
Looking only at a homepage, there is no way to distinguish between a site collection and a site. A site collection is basically nothing more than a container with a root site in it (SPSite.RootWeb in code). That root site (or web / SPWeb in sharepoint terms) can have other sub sites (webs) under it.
A web application contains one or more site collections. Site collections can be grouped together using managed paths that are defined in the Central adminstration. a managed path is either explicit or wildcard. explicit means only site collection can be created in that managed path, i.e.
http://rootsitecoll/explicitpath/
where the explcit managed path IS the new site collection's url.
Wildcard means 1 or more site can be created under the managed path, i.e.:
http://rootsitecoll/departments/departmentsite, where departments is a wildcard managed path.

Resources