Showing posts with label Search. Show all posts
Showing posts with label Search. Show all posts

Friday, June 26, 2015

Exclude checkin comments

I had a request to hide checkin comments from searchresults in Sharepoint 2013. I decided to hide the column from the index.

This can be done from UI
  1. Central Administration>Search Service>Search Schema > Crawled Properties> Ows__checkinComment
  2. Uncheck Include in full-text index
  3. Full crawl

Or with powershell
------setCrawlPropCheckInComments.ps1-----

Add-PSSnapin microsoft.sharepoint.powershell
$name = "ows__CheckinComment"

$searchapp = get-spenterprisesearchserviceapplication

$crawledprop = Get-SPEnterpriseSearchMetadataCrawledProperty -SearchApplication $searchapp -Name $name
$crawledprop.IsMappedToContents = $false
$crawledprop.update()
----------------eof--------------------------------------------
And full crawl

-----------startFullCrawlOnAllContents.ps1----------------
Add-PSSnapin microsoft.sharepoint.powershell

$contents = get-spenterprisesearchcrawlcontentsource -SearchApplication "Search Service Application"

foreach ($content in $contents)
{
if ($content.crawlstatus -eq "Idle")
{
write-host "Idle, running crawl on $($content.name)"
$content.StartFullCrawl()
}
else {write-host "$($content.name) is not idle or on nogo-list" }

}
----------------------------eof--------------------------------------

One thing to keep in mind is if CheckInComments column is visible on any Views on the site, that view will be returned in results.

References:
http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=242 
https://social.technet.microsoft.com/Forums/en-US/66c87e10-2e27-46e3-b176-27706f8e2fda/exclude-content-from-search-hithightlight-results?forum=sharepointgeneralprevious

Wednesday, March 26, 2014

Where’s my search dude?

I made a customer installation of Sharepoint Foundation 2013 recently. Naturally I used the latest Slipstreamed Microsoft package with Service Pack 1.

Sure everything looks fine at first, but after first site collection is up and running I notice that the searchbox is missing. Sure, maybe a glitch, runs new full crawl, but nothing changes. Tries to create a new search center site, site creator throws a sorry my way.

image

Tries to create my own custom page and add the search webpart and get another fun message “Common Language Runtime detected an invalid progam”.

image

Ok, maybe language is an issue, installs localization pack for swedish and creates new site collection. Same error.

After searching for information on the issue someone makes me aware of the fineprint of Slipstreampackaged Foundation downloadpage

image

First time that field contained any relevant information!

Searching on forums shows a few MS-cases that all indicates that this is an issue which will be fixed in the April CU. So we have to wait I tell the customer, looking like a noob cause they don’t want to put in the extra time for a reinstallation sans SP1.

But today I found an update that solved the issue!  Curiously not by googling but in my rssfeeds…

Hero of the day is: KB2760625 March 2014 PU for SharePoint Foundation 2013

Note the package is claiming to aimed at Sharepoint Enterprise Server but it worked nicely on my Foundation.

References:

http://support.microsoft.com/kb/2760625

http://www.microsoft.com/en-us/download/details.aspx?id=42268

http://www.sharepointblogs.be/blogs/vandest/archive/2013/12/10/sharepoint-foundation-2013-broken-search-experience.aspx

http://blogs.technet.com/b/stefan_gossner/archive/2014/03/20/an-important-fix-for-sharepoint-foundation-2013-sp1-has-just-been-released.aspx

Thursday, January 23, 2014

Thumbs in Searchresults in SP2010

Was working from sharepointblogs.com instructions trying to get Thumbnails from an Assetlibrary to be displayed in an Searchresultspage, but couldnt get the thumbs to stick.

Finally I tried removing “contentypeforsearch.=’image’  frome the xsl-customizations and it started working right away. Somehow the images in my results wasn’t interpreted as images. Maybe the .jpg filetype needs to added manually or something.

In this case, its a Imagesearch result page so the results are always images.

It works, im happy. customer happy. Done.

Before:

<xsl:when test="contenttypeforsearch[. = 'Image'] and contentclass[. = 'STS_ListItem_851']">

After:

<xsl:when test="contentclass[. = 'STS_ListItem_851']">

References:

http://blogs.msdn.com/b/david/archive/2011/06/27/previewing-audio-and-videos-in-sharepoint-2010-search-results.aspx

http://www.sharepointblog.com/2010/11/image-content-type-thumbnails-in-2010.html – the moneyshot

http://www.ableblue.com/blog/archive/2008/08/30/sharepoint-image-search-part-2/ – a bit old, still generally informational.

http://www.novolocus.com/2008/05/22/showing-thumbnails-in-search/

http://blogs.technet.com/b/anneste/archive/2008/11/25/mystery-solved-crawled-properties-in-sharepoint-part-5.aspx – details regarding how the crawling properties works.

Tuesday, October 29, 2013

Making Sharepoint Search better

Method for adding more relevant refiners to search. This method is relevant when using site content types for managing documents. For example having a MyDoc-Site Content Type with Site Column Department or labeling associated. This is handy when the enduser want a more relevant query filter.

 

  1. Make sure the column you want is
    1. a. Site Column
    2. b. Indexed on the list.
  2. Site Settings>Site Collection Administration>Search Schema
  3. Choose a refinable Managed Property depending on type of content. For example refinableString01
  4. Edit Refinable
    1. a. Change Alias to something more obvious
    2. b. Mappings to crawled Property > Add a mapping
    3. i. Search for the sought after crawled property. If theres more than one, choose one without ows_q in the name.
  5. Ok.
  6. Run new crawl.

References:

http://blogs.technet.com/b/tothesharepoint/archive/2013/06/19/stage-14-configure-refiners-for-faceted-navigation.aspx

Thursday, February 21, 2013

Sharepoint search returns property doesn’t exist

This error can occur if refinement calls for values that doesn’t exist in the search services Managed Properties.

When search has been executed, edit page and edit the Refinement Panel webpart property  imageunder Refinement>Filter Category Definition

Below is the standard output on a unedited. Compare to your values and see what differs.

<?xml version="1.0" encoding="utf-8"?><FilterCategories> <Category Title="Result Type" Description="The file extension of the item" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="0" SortBy="Frequency" SortDirection="Descending" SortByForMoreFilters="Name" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="FileExtension" MoreLinkText="show more" LessLinkText="show fewer"> <CustomFilters MappingType="ValueMapping" DataType="String" ValueReference="Absolute" ShowAllInMore="False"> <CustomFilter CustomValue="Adobe PDF"> <OriginalValue>pdf</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Email"> <OriginalValue>eml</OriginalValue> <OriginalValue>msg</OriginalValue> <OriginalValue>exch</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Excel"> <OriginalValue>odc</OriginalValue> <OriginalValue>ods</OriginalValue> <OriginalValue>xls</OriginalValue> <OriginalValue>xlsb</OriginalValue> <OriginalValue>xlsm</OriginalValue> <OriginalValue>xlsx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Image"> <OriginalValue>tif</OriginalValue> <OriginalValue>tiff</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Lotus Notes"> <OriginalValue>nsf</OriginalValue> </CustomFilter> <CustomFilter CustomValue="OneNote"> <OriginalValue>one</OriginalValue> </CustomFilter> <CustomFilter CustomValue="PowerPoint"> <OriginalValue>odp</OriginalValue> <OriginalValue>ppt</OriginalValue> <OriginalValue>pptm</OriginalValue> <OriginalValue>pptx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Publisher"> <OriginalValue>pub</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Text"> <OriginalValue>odt</OriginalValue> <OriginalValue>txt</OriginalValue> <OriginalValue>url</OriginalValue> <OriginalValue>csv</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Visio"> <OriginalValue>vdw</OriginalValue> <OriginalValue>vdx</OriginalValue> <OriginalValue>vsd</OriginalValue> <OriginalValue>vss</OriginalValue> <OriginalValue>vst</OriginalValue> <OriginalValue>vsx</OriginalValue> <OriginalValue>vtx</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Webpage"> <OriginalValue>ascx</OriginalValue> <OriginalValue>asp</OriginalValue> <OriginalValue>aspx</OriginalValue> <OriginalValue>htm</OriginalValue> <OriginalValue>html</OriginalValue> <OriginalValue>jhtml</OriginalValue> <OriginalValue>js</OriginalValue> <OriginalValue>mht</OriginalValue> <OriginalValue>mhtml</OriginalValue> <OriginalValue>mspx</OriginalValue> <OriginalValue>php</OriginalValue> <OriginalValue></OriginalValue> </CustomFilter> <CustomFilter CustomValue="XML"> <OriginalValue>xml</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Word"> <OriginalValue>doc</OriginalValue> <OriginalValue>docm</OriginalValue> <OriginalValue>docx</OriginalValue> <OriginalValue>dot</OriginalValue> <OriginalValue>nws</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Zip"> <OriginalValue>zip</OriginalValue> </CustomFilter> </CustomFilters> </Category> <Category Title="Site" Description="Which site this document is from" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="SiteName" MoreLinkText="show more" LessLinkText="show fewer" /> <Category Title="Author" Description="Use this filter to restrict results authored by a specific author" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="4" MaxNumberOfFilters="20" SortBy="Frequency" SortByForMoreFilters="Name" SortDirection="Descending" SortDirectionForMoreFilters="Ascending" ShowMoreLink="True" MappedProperty="Author" MoreLinkText="show more" LessLinkText="show fewer" /> <Category Title="Modified Date" Description="When the item was last updated" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="5" NumberOfFiltersToDisplay="6" MaxNumberOfFilters="0" SortBy="Custom" ShowMoreLink="True" MappedProperty="Write" MoreLinkText="show more" LessLinkText="show fewer" > <CustomFilters MappingType="RangeMapping" DataType="Date" ValueReference="Relative" ShowAllInMore="False"> <CustomFilter CustomValue="Past 24 Hours"> <OriginalValue>-1..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Week"> <OriginalValue>-7..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Month"> <OriginalValue>-30..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Six Months"> <OriginalValue>-183..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Past Year"> <OriginalValue>-365..</OriginalValue> </CustomFilter> <CustomFilter CustomValue="Earlier"> <OriginalValue>..-365</OriginalValue> </CustomFilter> </CustomFilters> </Category><Category Title="Enhet" Description="Enheter" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="3" NumberOfFiltersToDisplay="3" MaxNumberOfFilters="20" ShowMoreLink="True" MappedProperty="Enhet" MoreLinkText="show more" LessLinkText="show fewer" /></FilterCategories>

Wednesday, February 20, 2013

Search doesn’t work

Al too common issue is that searchfunction i Sharepoint blows a fuse for unclear reasons.

Usually when migrating sites from one server to another.

Following situation has occurred with Search Server 2010 Express & Sharepoint Foundation 2010 and Sharepoint Server 2013.

Symptoms:

  • Search returns “property doesn't exist or is used in a manner inconsistent with schema settings” clip_image001
  • Search throws an exception “Internal server error exception” clip_image002
  • Search just doesn’t find anything

This usually fixes it.

  1. Create new page based on Enterprise template Basic Search Page. Give it a good name like intranet.com/searchcenter/
  2. Try it if the search works there.
  3. If it does map the main searchfunction to this new searchcenter instead.
    1. Site Collection Administration> Search Settings
    2.  clip_image003
    3. Change Search Center Url to /searchcenter/ and change results page url to the one you got when you search from the searchcenter. Usually results.aspx if someone hasn’t been fiddling.

If the Search Service Application shows any funny business, like not being able to resolve user names. Its usually better to create a new SearchService.

What to think about when creating a new Search Service:

1. Make sure to use an account that has full dbo to the contentdatabases.

2. Make a full crawl after its created, make sure that your sites are listed in the “Content Source>Local Sharepoint Sites” settings in the SearchService Application. It usually is.

3. Edit Web Application Service Connection to make sure that the new Search Service Application is associated. Remove the old one.

Wednesday, September 26, 2012

Add network folder to Windows Library

If you want to add a network folder to your Windows 8 libraries you’re usually presented with a dialogue telling you that the folder needs to indexed.

This is the workaround.

1. Create folder on disk. For example : c:\images

2. Delete folder

3. CTRL+Q to search. cmd as admin.

4. mklink /d c:\image \\server\images

5. Done.

Now all images are easily accessed from your windows libraries. Plus they get indexed.

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...