none
Fulltext query is not returning the results

    Question

  • Hi Team,

    The officenumber property is not working with below full text query:

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, location, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') ) and contains(OfficeNumber, '"Melbourne*"') ORDER BY LASTNAME ASC 

    where as it is returning the results for officenumber with below query

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, location, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') )

    but department is giving results with both below fulltex queries.Please

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, OfficeNumber, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') ) and contains(Department, '"Human Resources*"') ORDER BY LASTNAME ASC
    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, OfficeNumber, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') )


    Please let me know what i have to check .


    MCTS,MCPD Sharepoint 2010. My Blog- http://devendra-sharepoint.blogspot.in
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

    Friday, August 31, 2012 2:19 PM

Answers

  • Hi devendra.sv,

    Please check the full text,

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, location, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') ) and contains(OfficeNumber, '"Melbourne*"') ORDER BY LASTNAME ASC

    When the contains(OfficeNumber,’”hr*”’) is true, and it also needs the third condition contains(OfficeNumber,’”Melbourne*”’) as true, so the OfficeNumber must be the two following “hr*” and “Melbourne”. Please check.

    If it’s not the issue, please feel free to let me know.

    Regards,

    Kelly Chen

    Monday, September 3, 2012 6:48 AM
    Moderator

All replies

  • hi Team,

    can anyone through some light on this issue.


    MCTS,MCPD Sharepoint 2010. My Blog- http://devendra-sharepoint.blogspot.in
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

    Sunday, September 2, 2012 3:04 AM
  • Hi devendra.sv,

    Please check the full text,

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, location, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"') or contains(OfficeNumber, '"hr*"') ) and contains(OfficeNumber, '"Melbourne*"') ORDER BY LASTNAME ASC

    When the contains(OfficeNumber,’”hr*”’) is true, and it also needs the third condition contains(OfficeNumber,’”Melbourne*”’) as true, so the OfficeNumber must be the two following “hr*” and “Melbourne”. Please check.

    If it’s not the issue, please feel free to let me know.

    Regards,

    Kelly Chen

    Monday, September 3, 2012 6:48 AM
    Moderator
  • Hi Chen,

    even if i remove the contains(OfficeNumber,’”hr*”’) from OR condition from the fulltext query its not returning the results.

    Select FirstName, LastName, Title, PictureURL, WorkEmail, WorkPhone, Department, AccountName, JobTitle, PreferredName, Path, location, MobilePhone, Skills from scope() where "scope" = 'People' and (contains(FirstName, '"hr*"') or contains(LastName, '"hr*"') or contains(Skills, '"hr*"') or contains(PreferredName, '"hr*"')) and contains(OfficeNumber, '"Melbourne*"') ORDER BY LASTNAME ASC
    if i remove the AND contains(OfficeNumber,’”Melbourne*”’)  i have the office number as "Melbourne" in results.



    MCTS,MCPD Sharepoint 2010. My Blog- http://devendra-sharepoint.blogspot.in
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

    Monday, September 10, 2012 5:00 AM
  • Just a word of warning that SQL Syntax support has been removed in SharePoint 2013.  Your query can easily be reconstructed using SQL Syntax. 

    http://msdn.microsoft.com/en-us/library/jj163951(v=office.15).aspx


    Corey Roth - SharePoint Server MVP blog: www.dotnetmafia.com twitter: @coreyroth

    Tuesday, September 11, 2012 1:24 PM