0

I'm creating FullTextSqlQuery to find some phases in files content. I have some test files uploaded on one of SPSite with content that match my query conditions. When I search in web browser, I'm getting my test file on result list.
Somehow my FullTextSqlQuery doesn't return those files as a result. There are some results but should be more. This is my query string:

SELECT Title,Path FROM SCOPE() WHERE "scope" = 'MyScope' AND ( freetext(DefaultProperties,'"tax recovery"') OR freetext(DefaultProperties,'"service fee"') OR freetext(DefaultProperties,'"hotel tax"') OR ( freetext(DefaultProperties,'"hotel"') AND freetext(DefaultProperties,'"sales tax"') ) OR ( freetext(DefaultProperties,'"hotel"') AND freetext(DefaultProperties,'"excise tax"') ) )

What I'm doing wrong? Hot to force SP to find all files that match query conditions?

4
  • Can you add some tags to indicate what version of SharePoint you are using? 2007 or 2010, Foundation or Server etc. Also, can you explain why you are using a SQL Query instead of plain FQL. Feb 7, 2014 at 17:39
  • Hi. I'm using SP 2010 server.
    – Neon
    Feb 10, 2014 at 11:58
  • And what about using FQL rather than SQL. SQL is deprecated in 2010 and removed in 2013. Feb 10, 2014 at 19:56
  • That is important information. Thank you. I will user FQL.
    – Neon
    Feb 10, 2014 at 22:11

1 Answer 1

0

The FQL for this would be something like: "tax recovery" OR "service fee" OR "hotel tax" OR "hotel" AND "sales tax" OR "hotel" AND "excise tax"

If you are performing a GET you can add the "sourceid" parameter to specify the desired Result Source in 2013. In 2010 you can add the "s" parameter to indicate the scope.

2
  • Is that correct syntax?: OR (string("tax recovery", mode="phrase") , string("service fee", mode="phrase") , string("hotel tax", mode="phrase") , AND (string("hotel", mode="phrase"), string("sales tax", mode="phrase")) , AND (string("hotel", mode="phrase"), string("excise tax", mode="phrase")) )
    – Neon
    Feb 11, 2014 at 12:52
  • It's off the top of my head, what does "mode=phrase" gain you? I was just mimicking the initial query. Feb 12, 2014 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.