Question

I'm following the link http://blogs.msdn.com/b/carloshm/archive/2012/12/16/how-to-use-query-rules-and-display-templates-to-detect-the-intent-of-your-users.aspx

to build a calculator out of the searchbox. I modified the regular expression to:

\d+\s*[/+-/*]\s*\d+

But I don't get it working with e.g. 23462634746-4

enter image description here
The reason I think is, that there are no results found in my SharePoint Local Results.

I also tried the regex:

[^d]*[/+/-/*/\][^d]*

But the calculator is only working if there is an item in SharePoint which contains something out of the query.

So I probably have to modifiy the query for the result block but only want the query to match if there is a calculation in the query.

enter image description here

Was it helpful?

Solution

Change the query to something like "*" so you get a result. enter image description here

enter image description here

OTHER TIPS

I published now a Step-by-Step guide for the calculator in my Blog.

Don't be afraIT.com to check it out.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top