NAME

Typesense::Client::Version - the server version, in a comparable form

SYNOPSIS

my $v = $ts->server_version;

say "$v";                          # 28.0
say $v->major;                     # 28

if ( $v->is_at_least('27.0') ) {
    # the analytics API changed shape more than once; gate on the server
}

DESCRIPTION

Returned by "server_version" in Typesense::Client, which reads GET /debug.

Typesense does not report a strict semantic version: 28.0 calls itself 28.0, and release candidates 28.0.rc35. This class reads the leading numeric components, treats the missing ones as zero, and keeps whatever else was there in "version_string". It never dies on an unexpected version string - a search client that refuses to work because the server named itself oddly would be worse than one that carries on.

METHODS

version_string

The string exactly as the server reported it. The object also stringifies to this, so "$version" works.

major, minor, patch

The numeric components, as integers. Missing components are 0.

comparator

if ( $one->comparator ge $two->comparator ) { ... }

A zero-padded string such as 028000000, so that two versions compare correctly with lt and ge. Numeric comparison would make 28.0 and 28.0.1 equal, and plain string comparison would sort 28.0 before 9.0.

is_at_least

if ( $ts->server_version->is_at_least('28.0') ) { ... }

True when this version is the same as, or newer than, the argument. Takes either a version string or another Typesense::Client::Version.

SEE ALSO

Typesense::Client

AUTHOR

SeHarrys

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by SeHarrys.

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.