FQL in SharePoint 2013
-
10-12-2019 - |
Question
Does anybody know how to do an FQL search in SharePoint 2013? I tried using REST service, and get "we didn't understand your search terms. Make sure they're using proper syntax"
http://**servername**/_api/search/query?querytext='and(string("Word",+mode="simpleall")'&enablefql=true
Any advise?
Solution
Did you enable it? Its disabled by default and has to be enabled through PowerShell.
OTHER TIPS
http://servername/_api/search/query?querytext='and(string("Word",+mode="simpleall")'&enablefql=true
first off you have an open bracket without a close bracket 'and(
, so do you mean:
http://**servername**/_api/search/query?querytext='and(string("Word",+mode="simpleall"))'&enablefql=true
but it still doesnt look right as it should look on the lines of
http://**servername**/_api/search/query?querytext='Wordtosearch'&enablefql=true
are you trying to performe some logic (and operator) on the query string? i dont know if that is possible but i could be wrong ;) shouldnt it be or, xrank or other? as and operator used like that is set for bool I think?
have a look on this:
this is for fql operators that you can use
http://msdn.microsoft.com/en-us/library/office/ff394606.aspx#fql_and_operator
and
http://msdn.microsoft.com/en-us/library/sharepoint/jj163876.aspx
i would assume that you would need the type (string, int, bool) then the () and within the brackets your word query seperated by , and mode="simpleall"
based on that and is correct and your url is correct, also based from msdn to me its:
http://**servername**/_api/search/query?querytext='and(string("Word"),mode="simpleall")'&enablefql=true
above shows that you have the and
wraping the string query (where you missed the bracket) followed but enablefql=true
.
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.
Kindly go through the following links to get more idea on FQL syntax,
http://msdn.microsoft.com/en-us/library/office/ff394606.aspx
http://msdn.microsoft.com/en-us/library/ff394628.aspx#int_overview_web_service
Hope this helps you.