next()

Description

Record next ([int count])

Wrapper method for retrieving the Record objects containing the data. The advantage of this function is that the user does not need to keep track of the records; next() will return records as long as there are records or alternatively until count records have been retrieved. For security issues, a hard-coded value of 10000 will be assigned to count unless a value is given.

Examples

Example of retrieving the first 10 records.


... initialize and search ...

while ($record = $search->next(10)) {
   ... process records ...
}

... clean up and end ...

Omitting the argument passed to next() will only return the first 10000 records, so if You suspect that there might be more hits (this is probably not very realistic) You have to pass the number of hits as an argument. The below example illustrates this.


... intilialize and search ...

while ($record = $search->next($search->hits())) {
   ... process records ...
}

... clean up and exit ...