rets api, Search function giving DMQL: Invalid Lookup criteria for field 'Change_Type'

154 views Asked by At

I am working on RETS API https://github.com/troydavisson/PHRETS

I am trying to search some parameters but getting error.

$search = $rets->Search("HISTORY", $class,  "Change_Type=*", 
array('Format' => 'COMPACT-DECODED',  'Count' => 1, 'Offset' => $offset));

getting the error

Fatal error: Uncaught PHRETS\Exceptions\RETSException: DMQL: Invalid Lookup criteria for field 'Change_Type'. in /rets/vendor/troydavisson/phrets/src/Session.php:424 Stack trace: #0 /rets/vendor/troydavisson/phrets/src/Session.php(280): PHRETS\Session->request('Search', Array) #1 /rets/bo3-history.php(96): PHRETS\Session->Search('HISTORY', 'History', '(Change_Type=*)', Array) #2 {main} thrown in rets/vendor/troydavisson/phrets/src/Session.php on line 424

Did anyone work on this?

1

There are 1 answers

0
troydavisson On

Couple of things with this, but probably still not enough to make this work:

  1. Allowing a field to be searched using an asterisk is not supported officially by RETS, though it is something some servers support anyway.
  2. When searching a lookup field, the operator on your DMQL query would be "=|", not simply "="

One thing you could potentially try:

Change_Type=|.ANY.