You are not logged in.
Pages: 1
Hi,
I'm trying to modify the PHP JSON sample code to covert the General Search to an Advanced Search but getting the error message :
SEARCH_QUERY_FIELD_CONDITION_INVALID
Can anyone point me in the right direction ?
Here is my request :
$strJSONRequest='{
"apiVersion":"1.0",
"sessionId":"' . $strSessionId . '",
"inParams":{"query":[{"fieldId":"Title","conditionId":0,"value":"SS"}],"fields":{"metadata":true}},
"action":"Search.AdvancedSearch"
}';
The general search which works ok is :
$strJSONRequest='{
"apiVersion":"1.0",
"sessionId":"' . $strSessionId . '",
"inParams":{"query":"4850","exactMatches":false},
"action":"Search.GeneralSearch"
}';
Thanks
Steve Smith
Aberystwyth
Offline
Hi Steve,
Try to supply a numeric value to fieldId instead . You can use Search_GetSearchConfiguration() to receive an array describing each possible seach field.
As an example, the following will search the keyword field for the word 'test'
http://yoursite.com/api/1.0/Search.Adva … rch/query=[{"fieldId":"106","conditionId":"0","value":"test"}]
Best Regards,
Steve
Offline
Thanks Steve,
I got the field ID number but still getting the same error with :
$strJSONRequest='{
"apiVersion":"1.0",
"sessionId":"' . $strSessionId . '",
"inParams":{"query":[{"fieldId":"1","conditionId":"0","value":"a"}]},
"action":"Search.AdvancedSearch"
}';
Steve
Offline
Pages: 1