SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Wildcards? We're not playing poker!

Lame title, I know.  But I'm pressed for time, so please bear with me Smile

Anyways, I wanted to take a quick second to point out something that is missing from Search in WSS v3 and MOSS 2007: wildcards.  If you already know what a search wildcard is, feel free to skip ahead to the next paragraph.  Wildcards are characters you use in a search query to signify that any content can be returned in its position.  So let's say I wanted to find all the .JPG files in a folder on my Windows workstation.  From a search in Windows Explorer within the target folder, I can type "*.JPG", and that query will return all the .JPG files in that folder, regardless of their name.  The asterisk (*) is the wildcard in my query, it represents all characters in the filename of the images.  If I searched for "john*.jpg", that query would only return the files that started with "john" and ended with ".jpg".

Often times in search engines, wildcard functionality is included inherently with your queries.  That means that if you search for ".jpg", the engine will return all records containing that string somewhere in their name, instead of only files explicitly named ".jpg".  This is pretty handy, especially when you don't know exactly what the file you're looking for is named. 

However, the SharePoint search engine in WSS v3 and MOSS 2007 does not use wildcards at all.  It does not implicitly include wildcards in searches, and if your query string reads "*.jpg", it will only look for files named ".jpg".  It will not return all the .JPG files in the search target.  So keep this in mind when you're running your searches.

NOTE: If you really need to use wildcards in your SharePoint searches, there is an alternative available to you.  Mondosoft has made the wildcard functionality of their Ontolica SharePoint search product free to anyone who wants it.  You can get it here: http://www.ontolica.com/Download/Request%20Product.aspx?prod=onwi 

I'd also like to thank Rob Bogue of Thor Projects and Leo Doyle of Mondosoft for pointing out this issue.


Posted 11-07-2007 4:01 PM by ferringer

Comments

tibballs wrote re: Wildcards? We're not playing poker!
on 11-07-2007 4:48 PM

It is possible to have some sort of 'wildcard' search by creating your own custom advanced search webpart which works the same way as searching on a property on the Advanced Search page.

Creating a webpart that does this will work with the existing search result webparts.

The main problem is this is that it will always do a prefix and suffix 'wildcard' search meaning that if you do a property search on Title = 'test' then the SQL syntax would look like Title LIKE '%test%'.

ferringer wrote re: Wildcards? We're not playing poker!
on 11-08-2007 9:33 AM

Adam --

That's an excellent point, but you're right about the limitations.  With that approach users wouldn't be able to nest wildcards in their queries (john%.jpg).

I think that thanks to the strong extensibility of the current SharePoint releases, it's definitely possible to develop your own custom search front end that would include wildcards.  The question that needs to be addressed is whether or not it's a good investment for your organization to do so.  

I would highly recommend making the same evaluation around using a third party product such as Ontolica or its competitors.  It's all too easy to fall in love with an add-on product for SharePoint without taking a look at the additional overhead that comes with its use.  

That being said, everyone's situation is different and its always great to be aware of other possible solutions to common problems.  Thanks for the info!

John

davidinark wrote re: Wildcards? We're not playing poker!
on 11-12-2007 1:25 PM

Wildcard searches should be an out-of-the-box feature.  Back in the days of Frontpage and ASP, I had created a very simple checkbox solution.  If the user did not want wild cards, they simply checked the "exactly" box.  I am no programmer, and if I can do it in stupid ASP, then Microsoft can add the same functionality in Sharepoint. Period.  It should not require some 3rd party add-on, free or not!

ferringer wrote re: Wildcards? We're not playing poker!
on 11-12-2007 2:37 PM

David --

Not to pour salt in the wound, but the crazy thing is that the MOSS search engine actually supports wildcard searches, so I am actually misspeaking a little in my post.  It turns out it's the Search UI that doesn't support wildcards.

Apparently there is an entry in one of the SDKs which covers how to do wildcards in the current version of SharePoint.  The really frustrating thing is that you'd have to build your own custom search web part in order to take advantange of the functionality.  But it was left out of the default Search UI, for what sounds like performance concerns.  To me, this feels like a pretty major omission, but I guess it's good for the third-party providers out there.

Thanks,

John

Josh Noble wrote re: Wildcards? We're not playing poker!
on 11-25-2008 2:58 PM

There are some wildcard alternatives out there but it is important to understand that most have severe limitations.  If you want to do a basic wildcard search you can find a free part, but don't expect it to work with peoplesearch, federated search or faceted search.  There is a reason that SurfRay is able to market Ontolica Wildcard for MOSS 2007.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.