Introduction
In this post I will describe a common mistake that occurs when you write your own FQL that impacts the search results that depends on Relevancy Ranking (Using Full Text Index Mapping).
Scenario
Lets consider that we have a list of products that we would like to search through that have a custom managed property weights defined to control Relevancy; The Full Text Index Mapping is configured as following:
- ProductName: Level 7 (High Importance)
- ProductDesc: Level 1 (Low Importance)
and lets say that other Dynamic Ranking options are disabled (such as Freshness, Boosts, Authority Weight … etc.) in this scenario to make things easier. So what happens if I searched for the product “XBox” using the following FQL:
(
(
ProductName:string(
“XBox”,
mode=”simpleany”
)
)
) or (
ProductDesc:string(
“XBox”,
mode=”simpleany”
)
)
What I expect to see is that the search results will bring the result items that has the word “Xbox” in the ProductName first due to my relevancy configuration, but that doesn’t happen, why?
The Problem:
To understand the problem lets check the official definition of FQL from Microsoft MSDN Site:
The FAST Query Language (FQL) is a powerful query language that enables developers to perform exact searches and to narrow the scope of your search to values that belong to a specific managed property or a full-text index.
So what happened here is that the Exact Managed Property Search kicked in and disabled the Dynamic Ranking (using Full Text Index Mapping).
Solution
To solve this issue you need to remove the managed properly names from your query and rephrase it as following:
(
(
string(
“XBox”,
mode=”simpleany”
)
)
)
This will enable the Full Text Index Mapping on your reach results and brings in the results that are ordered in the ProductName first.
Note:
For the sake of this scenario I disregarded the number of occurrence of the word “Xbox” in the search results to make it easier to understand, please note that this issue will also affect the order of the search results.
Additional References
More useful information can be found in the below links:
- Index Schema – http://msdn.microsoft.com/en-us/library/ff464344(v=office.14).aspx#schema_concepts_full_text
- Ranking & Sorting – http://msdn.microsoft.com/en-us/library/ff394654(v=office.14).aspx
- FAST Search for SharePoint Relevancy Post by Eric – http://fs4sp.blogspot.ae/2012/01/fast-search-for-sharepoint-relevancy.html
- FAST Query Language (FQL) Syntax Reference – http://msdn.microsoft.com/en-us/library/ff394606(v=office.14).aspx
You must log in to post a comment.