I'm new to SharePoint 2013 and I'm quite puzzled, that it seems to be impossible to search for the middle part of a string.

Simple example:

I've added a lot of documents (PDFs, ...) from our Windows Server to the SharePoint Library and I want to add metadata. I try to filter the view of the document library, to only get those documents which I currently want to edit.

The names of the documents are very systematic, composed of naming conventions with abbreviations like:

which means e. g.: Document about Product "Superthing2000", variant "b", Supplement to the manual, ID "13580", from 08/2011 in english language.

Now, I'd like for example to filter out all documents containing ID 13580 or "en" for english, but no chance, as suffix matching is not possible, even if I explicitly search for e. g. *en*.

Is there a way to define a search with kind of a "contains" operator which also finds files when the search string is only a part in the middle of the file name? Even the Windows Explorer search feature is able to do that!!

  • Are you sure it doesn't work? According to this msdn page (msdn.microsoft.com/en-us/library/office/ee558911.aspx) wildcard operator is indeed allowed – MdMazzotti Jan 29 '14 at 13:07
  • 1
    yes, at least I am sure that it does not work in our current SharePoint setup, as I tried it out in many ways. The Asterisk at the beginning of a word has no effect at all, if I search for SuperThing*, I'll only get results where a word starts with SuperThing, but e. g. not the document called Meetingreport_SuperThing_2013-12.docx – mBBe Jan 29 '14 at 13:11
  • 2
    had a second read at the msdn. In effect, KQL queries don’t support suffix matching, so I fear you're out of luck with this one – MdMazzotti Jan 29 '14 at 13:17

The * wildcard character is only supported for prefix matching, "wild*" not "*card". I would suggest you expand your approach for tagging your documents. I would suggest you use SharePoint metadata to tag your documents rather than just creating a title. For example add a field for Document, Product, Variant, Supplement, ID, PublishedDate and Language. If you use site columns in SharePoint 2013 they will be converted to Managed Properties for you and then you can perform a search using KQL or refinement.

For example: Product:"Superthing2000" Variant:"b" ID="13580" PublishedDate>08/01/2011

There are several ways to automate the extraction of the data, an event receiver could be writte to resolve this very easily.

  • 1
    thanks for your answer! We do have an expanded approach for tagging (which comprises all this information about products etc), but the question is how to migrate the existing data in the beginning. I hoped I could (as described) filter the documents in the document library by their name (which would require the suffix matching) and then with the "Quick Edit" tabular view quickly assign the appropriate metadata to the selection of files. – mBBe Feb 4 '14 at 9:00
  • 3
    I would write client side code to enumerate the list and implement the tagging. You can do this in PowerShell or write a utility depending on your coding strength. – Matthew McDermott Feb 4 '14 at 10:59
  • hi Mathew,i am facing an issue with the wild card * as suffix in my ent.search site collectio. when i search for a document "supplier*" , i am getting the search results but an increasing number of search results. in the first page it shows, the num o docs for srch results is 15 , in the next page after pagination, it shows 25, in the third page it shows , as 35 etc ..why this strange behaviour occuring in search results page. Need your help! – userAZLogicApps Feb 1 '17 at 11:29
  • This is a common behavior in SharePoint. It estimates the number of results. As you paginate through the result set the estimate is improved. – Matthew McDermott Feb 1 '17 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.