Thursday, November 10, 2016

Don’t be afraid of spaces in your query templates


I was talking to Andrew Clark and he was pretty frustrated after debugging a search issue. Turned out the query template was written like this:


Notice the lack of a space between {searchTerms} and path. So when adding query variables, throw in some spaces and you can cut a lot of frustration when debugging. If not the the last query term will have path appended to it as part of the term like: foopath: instead of foo path: 

The right syntax is:

{searchTerms} path: