Facing the dreaded “Your query is malformed. Please rephrase your query.” when using FS4SP scopes

You read Jørgen’s great blog post and learned that scopes in FAST Search for SharePoint 2010 (FS4SP) are simply FQL (FAST Query Language) filters, so you followed the instructions and created your own scopes with a command more or less like this:

New-SPEnterpriseSearchQueryScope -SearchApplication "FASTQuery" -Name FASTContosoScope -Description "Scope for FAST Contoso content source" -DisplayInAdminUI 1 -ExtendedSearchFilter "contentsource:FAST Contoso"

After compiling your scope and everything, you try to use it in a search center and instead of results you get this message:

Your query is malformed. Please rephrase your query.

Your query seems to be fine and you don’t see what could be wrong, but there is a small detail you overlooked. Since “FAST Contoso” is a query with multiple terms, you need to use double quotes around it to be considered a proper FQL query. Now how can you do that if you are already using double quotes to define the ExtendedSearchFilter parameter in the PowerShell command?

The trick here is to use single quotes on the outside to define the ExtendedSearchFilter parameter and double quotes on the inside to define the FQL query with multiple terms:

$scope = Get-SPEnterpriseSearchQueryScope –SearchApplication "FASTQuery" -Identity "FASTContosoScope"
$scope.Filter = 'contentsource:"FAST Contoso"'
$scope.Update()

Don’t forget that you need to compile your scope again to be able to test it immediately, by clicking on “Start update now” at the entry page for the FASTQuery SSA:

image

After these steps you show get your results normally without any problems when using your scope. Cheers! Smile

About these ads

About leonardocsouza

Mix together a passion for social media, search, recommendations, books, writing, movies, education, knowledge sharing plus a few other things and you get me as result :)
This entry was posted in FS4SP and tagged , , . Bookmark the permalink.

2 Responses to Facing the dreaded “Your query is malformed. Please rephrase your query.” when using FS4SP scopes

  1. Kevin Krueger says:

    Thanks Leonard, nice post! The details matter!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s