Bypassing max limit and without offset

577 views
Skip to first unread message

deltaf

unread,
Dec 20, 2010, 2:56:34 PM12/20/10
to PHRETS
As one would imagine, I'm using phRETS to download a large number of
records from the regional RETS server. The server does NOT support
Offset, and only returns 2000 records even when a limit of 999999999
is set explicitly.

How can I pull more records without offset support? Could the account
be limited by permissions?

The MarketLinx RetsConnector tool has a checkbox indicating it can
bypass limits using an "index".

Any help is welcome, thanks!

RETS

unread,
Dec 20, 2010, 4:16:26 PM12/20/10
to PHRETS
Have you tried-

$rets->SetParam("offset_support", true);

$limit = 300; (or whatever its stalls out at)
$offset = 1;
while ( $limit >= $offset ) {...your code here....
$offset = $offset + $limit;

Troy Davisson

unread,
Dec 20, 2010, 5:12:04 PM12/20/10
to phr...@googlegroups.com
Regarding the "index" selection, that's a new feature specific to RETS 1.7.2 .  If:

  1. You're only interested in getting back certain fields (via the "Select" parameter), AND
  2. The fields you want back are all listed as being in an index, AND
  3. You send a "Limit" parameter equal to "NONE", AND
  4. Connect to the server using RETS 1.7.2
Then the server will suspend the rows-per-response limit and give you back a single, complete response with everything.

Typically, only the MLS# field is included in the index (and maybe a few other fields) so this feature is typically used to retrieve back a single, complete list of all of the MLS#'s.  Once you have that list, you can make batch requests to the server to retrieve back the entire record (obviously keeping your batches below 2000. I'd recommend maybe 100 or 200 per batch).

http://retsmd.com can help you a bit with this.  Be sure to select 1.7.2 from the login screen.  When you pull up the field list, a red heart symbol will appear next to each field included in the index.  Only fields marked with the heart symbol can be included in your "Select" parameter.


Other than using the method above, I've seen a lot of different ways to get around it.  More than one RETS server vendor sorts records returned.  If, say, the field sorted is the Modification Timestamp field, you'd get your 2000 records back and pluck out the timestamp from the last record.  Then, you'd issue a follow up query to get back all records since that plucked out timestamp.  Get the next 2000, pluck the timestamp, re-issue query.

I've also seen other techniques like using price ranges that are close enough together where they'll never give back more than 2000 records each.

Good luck!

Troy




--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To post to this group, send email to phr...@googlegroups.com.
To unsubscribe from this group, send email to phrets+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/phrets?hl=en.


Reply all
Reply to author
Forward
0 new messages