Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm looking for a way to do searches with FAST Search Server 2010 based on Regular Expressions.

For instance, I'd like to be able to use:

^\d{3}-\d{2}-\d{4}$

And have it return any content that looks like a Social Security Number. Any ideas?

share|improve this question
    
i think FQL is way faster than regex, why do you want to use regex specifically as long as FQL is fast ? –  Kariem Soudy Jan 14 '12 at 12:57

2 Answers 2

up vote 2 down vote accepted

This is not possible as FAST supports FQL (FAST Query Language) and not regular expressions.

Your best bet is to create an external processors which uses regexp to find social security numbers.

If you find a match, assign the value "true" or similar to a crawled property. Then create a managed property of type bool which you map this crawled property. When searching you can then do a query like: hassocial:1, which will return all items with this flag set.

share|improve this answer
    
Thanks @Mikael. Do you have any examples (or links to) of how to do this? –  John Chapman Jan 14 '12 at 20:13
    
See Nico's comment or some sample code on my blog techmikael.blogspot.com/2010/12/…. And see technet.microsoft.com/en-us/library/ff191245.aspx for working with crawled and managed properties. –  Mikael Svenson Jan 15 '12 at 12:19

There is no way to do this.
What you can do is detect security numbers at indexing time (with regex if you want) and add them to a managed property like "detectednumbers".

Then you can query document that contains a number, or only document that contains a specific number.

I'm afraid this is the only way to go.

share|improve this answer
    
Thanks @Nico, do you have any examples of how to do this? Thanks. –  John Chapman Jan 14 '12 at 20:13
    
Here is how to add custom code into the pipeline. Then you'll have to parse the body property using your regex: msdn.microsoft.com/en-us/library/ff795801.aspx –  Nico Jan 15 '12 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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