Do you know the number of times I got the question: what do we have to do to enable wildcard search in the Search Center with MOSS 2007? This week also, with the MS folks in my course, search and the customization was leading to a lot of discussions. And I got challenged again with the question. So I decided to drill down into it a bit more and talk to my good friend Lars from Mondosoft - the leading search company in Europe and probably in the world. Here is my conclusion, a harsh one for everybody that was looking for the easy change as was the case with SPS 2003: 'wildcards are not possible without either buying Ontolica Search or investing in a deep (read development extensive) customization of the search center'. The reason for this is that your search query is executed by a hidden object (Microsoft.Office.Server.Search.WebControls.SearchResultHiddenObject) that you do not have access to. This will translate the query to a keyword syntax query execution by default unless you go to the advanced search page. A query initiated here will result in the use of the full text sql query syntax (making use of a lot of undocumented fields). And no, no intervention possible. No easy way of changing the template used by this object for executing the query.
I don't understand the reasons behind this that much. There are numerous properties exposed by the different Web parts. Was it so difficult to expose one more: Enable wildcard search where they internally replace the FREETEXT part with a CONTAINS part? Well, nope. Maybe somebody in Redmond can explain this more what the reasons were. Anyway, it is very very good news for Lars and his company Mondosoft because they are back in business :) (they would have been even if wildcard search was supported OOB). And to tease you to buy their new release of Ontolica Search, they are going to offer a free community version of it, and guess what, it will enable wildcard search!!! Good job guys, can't wait to see you in Berlin for the first public demonstration of the new product!
Update: It seems I raised some eyebrows on the other side of the ocean. Don't worry, I hoped it was going to. It all is going to end up with positive information. Lawrence wrote me to explain the support in the keyword syntax. Fair enough but not good enough for a customer I am afraid. And when you read the title of the posting, please know that 'out-of-the-box' for me is equal to 'directly available or easy to turn on or customize'. So, yes MOSS supports wildcards, but not in an easy way.
- OOTB with the keyword syntax we don’t have full wildcard support. We do have prefix match, on property queries in the keyword syntax. However, it is not possible to query for a prefix on a multi-term.For example, you can submit the query author:Lawr and match on author=Lawrence. But you cannot specify author:(Lawrence L) and hope to match on all the people with a first name Michal and last name that start with “L” because we don’t have the equivalent of parenthesis
- With a custom web part, using the SQL syntax, you can perform wildcard searching (you can use suffix wildcards in the contains clause, or you can use a slow LIKE clause with any wildcards for additional property matching). Note that replacing the freetext with contains will influence the ability to order by rank.