Documentation for CONTAINS() in FQL?

前端 未结 1 835
庸人自扰
庸人自扰 2021-01-21 17:09

There have recently been several questions posted on Facebook.SO using CONTAINS() in the WHERE clause. It seems to work like the Graph API search funct

相关标签:
1条回答
  • 2021-01-21 17:48

    I don't think that a have any great answers here, but I can give a workaround for the issue of returning unrelated names- which I suspect is because people have made public posts about Joe Biden, liked him, or so on. If you do the following:

    SELECT name
    FROM   user
    WHERE  CONTAINS("Joe Biden")
    AND    strpos(lower(name),lower("Joe Biden")) >=0
    

    You will get a resultset that only contains the right names- though it removes the advantage of also returning Joseph Biden, etc. etc.

    My personal point of pain is that CONTAINS() appears to work with partial strings (e.g. "Joe Bide") on the profile table, but not on the user table. Very frustrating.

    0 讨论(0)
提交回复
热议问题