Error: "RootWebOnly='FALSE'" is True…

I wrote a feature to deploy a couple of pages into a Pages library on a site. The idea was that these were search pages, and they’d be going into a Search Center. My feature had an Elements manifest of:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomSearchPages" Url="Pages" RootWebOnly="FALSE" Path="Pages">
<File Url="advanced.aspx" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary">
</File>
<File Url="contentresults.aspx" IgnoreIfAlreadyExists="TRUE" Type="GhostableInLibrary">
</File>
</Module>
</Elements>

Yet when I activated this on my Search Center, the pages weren’t installed. This was weird, ‘cos I’d done nearly exactly the same thing to install my custom Master page. I began swapping bits of the Master Page feature into my Search Pages feature to see if they worked, which at first they didn’t. Then, by accident, I tried installing my Search Pages on my root site, and they did install.

Interesting.

There followed a bit of wild, stab-in-the-dark guessing. I’d seen lots of examples of installing new page layouts, or installing new master pages. These should all go in the root site (or ‘root web’), and so their Module node would specify RootWebOnly="TRUE". I could find very few results, though, where RootWebOnly="FALSE", which is a little unusual on Google. What if the thing that made a module only install on a root site was the presence of a RootWebOnly attribute, rather than the value of it? I tried:

<Module Name="CustomSearchPages" Url="Pages" Path="Pages">

for my module tag. Well, that’s what it turned out to be. I removed the RootWebOnly="FALSE" attribute, and suddenly my pages would install. I guess I was stupid for trying to be explicit in saying that this feature was not only for the root site. I’ve gotta be honest, that sucks, and it wasted me 4 hours. Clearly, it shouldn’t just be the presence of the attribute; by setting it to False I was saying specifically that the feature was not for root sites only. Someone was shoddy in their processing of the XML.

Error: "RootWebOnly='FALSE'" is True…

Regular Expression Validated Column in SharePoint

What a great discovery – a Regular Expression Validated column on Codeplex. I’ve been talking about writing one of these for about 6 months – and Gael Duhamel has written one for me! Kudos!

I’ve not tried it yet, but I’m putting it to the top of my ‘things to try’ list. As my colleagues know I love regular expressions, and I rather feel this should be OOB.

Regular Expression Validated Column in SharePoint

SharePoint Search doesn't have Wildcard searching

Yesterday I described Search Stemming and how to set it up. I thought I’d have a look at Wildcard searching and discovered (to my shock) SharePoint Search doesn’t have general wildcard searching.

This isn’t news – the normally evangalistic Patrick Tisseghem posted about this a year and a half ago, and plenty of folks have expressed their surprise at this. I can’t say I blame them. There are third party products that given general wildcard searching, but I’ve not see or used any of them, and some of them get mixed reviews.

You might have noticed that I spoke specifically about general wildcard searching. Well, you can do wildcard searching when you’re search for a property of a particular value. For example, a search for Title:Water would return results about water, waterloo, watergate, watering, Muddy Waters, etc.. Perhaps a comparison would be useful to make things clearer. Continue reading “SharePoint Search doesn't have Wildcard searching”

SharePoint Search doesn't have Wildcard searching

Search Stemming in SharePoint

So, my playing with search recently has shown that the search stemming in SharePoint is turned off by default. Search stemming is what takes a search term like ‘Fill‘ and also matches against ‘Filling‘ and ‘Filled‘. This is different to wildcards – ‘Fill*‘ would also match words like ‘Fillet‘. Here is an example of searching for Apple and Apples without stemming… Continue reading “Search Stemming in SharePoint”

Search Stemming in SharePoint

Create an Image only Search Scope in Sharepoint

Previously I’d looked at having a search that shows thumbnails of images in SharePoint. I modified the results page to do this – but the results themselves would still show non-Picture items (e.g. documents, pages, etc.). In this post, I’ll configure up a new Search Scope for images only. Continue reading “Create an Image only Search Scope in Sharepoint”

Create an Image only Search Scope in Sharepoint

Showing Thumbnails in Search

One of my colleagues was asking about building a search which would show thumbnails for images, and whether that was possible. I decided to try a 5 minute prototype, so I took a copy of the results.aspx page in my Search Center, and started hacking…

I have a Picture library with some images in it (they’re pinched from Flickr, so sorry for the copyright thing to their respective owners – but they’re lovely looking test data). You might notice that the images in the pictures Library are already thumbnailed:

Picture Library with Sample pictures

Firstly, I took a look at all the xml I was getting back from the search results. (You can add to that.)

Search results XML

Great! So I’m getting the thumbnail for the picture through in the search results, and I can also identify what pictures are by the ContentClass. Nice one!

Normal Results pages XSL

The first thing I noticed on opening up the XSL for the normal results page was that there is a section about showing a thumbnail. Normal search results don’t show a thumbnail though – so what gives?

Well, there are a few conditions before it’ll show the thumbnails – the ContentClass of the result (which is okay), the presence of a thumbnail URL, and the variable $IsThisListScope being true. I’m not sure what the $IsThisListScope variable is for, but I decided to delete it from the condition. As the other parts are met the results should show thumbnails for items which have them (i.e. Pictures).

Redesigned XSL

And if I perform a search for, say, balloons, then I get some results with thumbnails:

Results page showing Thumbnails.

Now, it’s worth noting, this page will still show non-pictures results – just my results didn’t have any. The next step would be to create a scope to only include images.

Showing Thumbnails in Search

The curious incident of the date column in the night-time

I have been tearing my hair out over a problem with dates and timezones. We have a site column ‘Document Date’ that we are using in our search results page. It only holds a date.

Our client noticed that some dates appeared on the search results page as a day earlier than the value in the lists themselves. For example, the list would show a document date of the 8th of May, but the search results would show the 7th of May. Curious, and the start of a bit of a detective story… Continue reading “The curious incident of the date column in the night-time”

The curious incident of the date column in the night-time

Setting the date format on SharePoint's Central Admin Site

This blew me away – Central Admin in SharePoint 2007 doesn’t have any ‘Regional Settings’. Now, at one level, this might make sense – perhaps you always want it to match, say, the server time, or UTC time. I’m not convinced, but it might make sense.

<rant>What absolutely doesn’t make sense is that the date format it uses is the stupid American ‘mm/dd/yyyy‘ format. Why can the US not accept that the rest of the Gregorian calendar using world (i.e. nearly everywhere else) uses a format of ‘dd/mm/yyyy‘? I mean, isn’t sensible to have a format that offers a gradiated precision of time, rather than dumping the most specific part of it in the middle? Or, if we wanted to accept that central admin will probably only be used by techies, what’s wrong with ‘yyyy-mm-dd‘? Hell, I’d nearly prefer Javascript’s ‘milliseconds since the start of 1970‘ format (nearly, but not quite).

Make the format configurable, or use a standard format like ‘yyyy-mm-dd’. </rant>

I did find some solutions though – I particularly like the way that is transpires that the regional settings page is there, but that you have to enter the URL by hand…

Setting the date format on SharePoint's Central Admin Site

Hit Highlighting in SharePoint Search Document Titles

I came across an interesting behaviour in a search results page I’ve been working on. I’d added some code to do search highlighting on the results of a query. Here’s an example of the results I got for a search for ‘Barnacles’:

Search Results showing Hit Highlighting in the Titles and Description of documents

The observant amongst you will notice that the titles all contain the word ‘Barnacles’, but only some are highlighted – specifically where the word barnacles is not the last word before the dot-extension of the file name. I did some further testing and found that the search does recognise the word ‘Barnacles’ in the file name, but the hit highlighting doesn’t seem to. Continue reading “Hit Highlighting in SharePoint Search Document Titles”

Hit Highlighting in SharePoint Search Document Titles