================================================================================
FIND name
================================================================================

FIND {joe}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND full name
================================================================================

FIND {Joe Smith}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND In Name
================================================================================

FIND {Joe Smith}
IN Name Fields
RETURNING Lead

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))
        (in_clause
          (in_type))
        (returning_clause
          (sobject_return
            (identifier)))))

================================================================================
FIND Lead Fields in Name
================================================================================

FIND {Joe Smith}
IN Name Fields
RETURNING lead(name, phone)

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))
        (in_clause
          (in_type))
        (returning_clause
          (sobject_return
            (identifier)
            (selected_fields
              (field_identifier
                (identifier))
              (field_identifier
                (identifier)))))))

================================================================================
FIND WHERE
================================================================================

FIND {Joe Smith}
IN Name Fields
RETURNING lead (name, phone Where createddate = THIS_FISCAL_QUARTER)

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))
        (in_clause
          (in_type))
        (returning_clause
          (sobject_return
            (identifier)
            (selected_fields
              (field_identifier
                (identifier))
              (field_identifier
                (identifier)))
            (where_clause
              (comparison_expression
                (field_identifier
                  (identifier))
                (value_comparison_operator)
                (date_literal)))))))

================================================================================
FIND Text OR
================================================================================

FIND {"Joe Smith" OR "Joe Smythe"}
IN Name Fields
RETURNING lead(name, phone), contact(name, phone)

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))
        (in_clause
          (in_type))
        (returning_clause
          (sobject_return
            (identifier)
            (selected_fields
              (field_identifier
                (identifier))
              (field_identifier
                (identifier))))
          (sobject_return
            (identifier)
            (selected_fields
              (field_identifier
                (identifier))
              (field_identifier
                (identifier)))))))

================================================================================
FIND Wildcards 1
================================================================================

FIND {Joe Sm*}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Wildcards 2
================================================================================

FIND {Joe Sm?th*}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Logical Literal 1
================================================================================

FIND {"and" or "or"}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Logical Literal 2
================================================================================

FIND {"joe and mary"}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Logical Literal 3
================================================================================

FIND {in}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Logical Literal 4
================================================================================

FIND {returning}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Logical Literal 5
================================================================================

FIND {find}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Escaped Special Char 1
================================================================================

FIND {hello \} world}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Escaped Special Char 2
================================================================================

FIND {asterisk \*}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Escaped Special Char 3
================================================================================

FIND {question \?}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Escaped Special Char 4
================================================================================

FIND {single quote  \'}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

================================================================================
FIND Escaped Special Char 5
================================================================================

FIND {double quote  \"}

--------------------------------------------------------------------------------

    (source_file
      (sosl_query_body
        (find_clause
          (term_separator_start)
          (term)
          (term_separator_end))))

