The Alfresco Search Query can reference properties from the Salesforce object using the standard Salesforce notation of {!<Object>.<property>}. For example {!Opportunity.Name} would display the name of the Opportunity record where the Visualforce page is being displayed.
You can use complicated business logic, or reference object properties that don't have a child relationship to the object, through additional Apex code referenced in the extensions attribute of the apex:page tag.
If a property could have characters that may break the structure of a JSON file they should be wrapped in a Salesforce JSENCODE formula function i.e. {!JSENCODE(Opportunity.Name)}.
Example with Salesforce object field pickvalue (single-valued and mandatory):
{[
{"id":1,"name":"My 1","query":"=myprefix:myprop1:{!Opportunity.LeadSource}"}
]}
Example with Salesforce object field pickvalue (single-valued and optional):
{[
{"id":1,"name":"My 1","query":"{!IF(ISBLANK(Opportunity.LeadSource),(''),('AND =my:prop:'+Opportunity.LeadSource))}"}
]}
Note
In this example, the extra property match is not applied if the field is not set.