I've created a few documents and tagged them with various Taxonomy Terms from a Term Set. The terms I have chosen are children of other Terms. I've executed a crawled and created a Managed Property called TaxonomyTerms which maps to all the crawled properties for the Managed MetaData fields I created.
I issue a query using the FullTextSQLQuery like so...
SELECT Title, TaxonomyTerms FROM Scope() WHERE "scope" = 'All Sites'
... and I get a data table containing all the documents I created. I output the TaxonomyTerms property and verify that all the GUIDs for the terms are in the field.
Next, I execute the following query...
SELECT Title, TaxonomyTerms FROM Scope() WHERE "scope = 'All Sites' AND
TaxonomyTerms = '#1235-6789-0123-4567'
...with the number above being a fictional GUID for the purposes of this example.
I get 0 results back from FullTextSQLQuery.
I try similar queries against the individual owsTaxIdFieldName properties and the ows_taxid_MetadataAllTagsInfo property and still received no results.
According to the syntax detailed in this MSDN article and several other blog articles I have read about writing SQL queries with Term guids, the above query is correct.
But it doesn't work. I'm kind of banging my head on the wall here. Being able to execute a query by Taxonomy GUID is fundamental to the success of my project.
If anyone can provide direction, I would appreciate it.