11## Introduction ##
22
3- The Predis Vector Library (PredisVL ) is a PHP client for AI applications leveraging Redis.
3+ The Redis Vector Library (RedisVL ) is a PHP client for AI applications leveraging Redis.
44
55Designed for:
66- Vector similarity search
@@ -13,21 +13,21 @@ full-text search, and geo-spatial search.
1313
1414### Installation ###
1515
16- For now PredisVL isn't available at packagist.org, but you can still install it via Composer by specifying [ GitHub
17- repository] ( https://github.com/RedisVentures/predis-vl ) in your composer.json file.
16+ For now RedisVL isn't available at packagist.org, but you can still install it via Composer by specifying [ GitHub
17+ repository] ( https://github.com/RedisVentures/redis-vector-php ) in your composer.json file.
1818
1919``` shell
2020{
2121 " repositories" : [
2222 {
2323 " type" : " github" ,
24- " url" : " https://github.com/RedisVentures/predis-vl .git"
24+ " url" : " https://github.com/RedisVentures/redis-vector-php .git"
2525 }
2626 ]
2727}
2828```
2929``` shell
30- composer install redis-ventures/predis -vl
30+ composer install redis-ventures/redis -vl
3131```
3232
3333### Setting up Redis ####
@@ -78,7 +78,7 @@ $schema = [
78782 . Create a SearchIndex object with an input schema and client connection to be able to interact with your Redis index
7979``` php
8080use Predis\Client;
81- use RedisVentures\PredisVl \Index\SearchIndex;
81+ use RedisVentures\RedisVl \Index\SearchIndex;
8282
8383$client = new Client();
8484$index = new SearchIndex($client, $schema);
@@ -104,7 +104,7 @@ Define queries and perform advanced search over your indices, including combinat
104104
105105** VectorQuery** - flexible vector-similarity semantic search with customizable filters
106106``` php
107- use RedisVentures\PredisVl \Query\VectorQuery;
107+ use RedisVentures\RedisVl \Query\VectorQuery;
108108
109109$query = new VectorQuery(
110110 [0.001, 0.002, 0.03],
@@ -119,8 +119,8 @@ $results = $index->query($query);
119119
120120Incorporate complex metadata filters on your queries:
121121``` php
122- use RedisVentures\PredisVl \Query\Filter\TagFilter;
123- use RedisVentures\PredisVl \Enum\Condition;
122+ use RedisVentures\RedisVl \Query\Filter\TagFilter;
123+ use RedisVentures\RedisVl \Enum\Condition;
124124
125125$filter = new TagFilter(
126126 'categories',
@@ -150,8 +150,8 @@ Numeric filters could be applied to numeric fields.
150150Supports variety of conditions applicable for scalar types (==, !=, <, >, <=, >=).
151151More information [ here] ( https://redis.io/docs/interact/search-and-query/query/range/ ) .
152152``` php
153- use RedisVentures\PredisVl \Query\Filter\NumericFilter;
154- use RedisVentures\PredisVl \Enum\Condition;
153+ use RedisVentures\RedisVl \Query\Filter\NumericFilter;
154+ use RedisVentures\RedisVl \Enum\Condition;
155155
156156$equal = new NumericFilter('numeric', Condition::equal, 10);
157157$notEqual = new NumericFilter('numeric', Condition::notEqual, 10);
@@ -167,9 +167,9 @@ Tag filters could be applied to tag fields. Single or multiple values can be pro
167167equality conditions (==, !==), for multiple tags additional conjunction (AND, OR) could be specified.
168168More information [ here] ( https://redis.io/docs/interact/search-and-query/advanced-concepts/tags/ )
169169``` php
170- use RedisVentures\PredisVl \Query\Filter\TagFilter;
171- use RedisVentures\PredisVl \Enum\Condition;
172- use RedisVentures\PredisVl \Enum\Logical;
170+ use RedisVentures\RedisVl \Query\Filter\TagFilter;
171+ use RedisVentures\RedisVl \Enum\Condition;
172+ use RedisVentures\RedisVl \Enum\Logical;
173173
174174$singleTag = new TagFilter('tag', Condition::equal, 'value')
175175$multipleTags = new TagFilter('tag', Condition::notEqual, [
@@ -184,8 +184,8 @@ Text filters could be applied to text fields. Values can be provided as a single
184184specified condition. Empty value corresponds to all values (* ).
185185More information [ here] ( https://redis.io/docs/interact/search-and-query/query/full-text/ )
186186``` php
187- use RedisVentures\PredisVl \Query\Filter\TextFilter;
188- use RedisVentures\PredisVl \Enum\Condition;
187+ use RedisVentures\RedisVl \Query\Filter\TextFilter;
188+ use RedisVentures\RedisVl \Enum\Condition;
189189
190190$single = new TextFilter('text', Condition::equal, 'foo');
191191
@@ -205,9 +205,9 @@ Geo filters could be applied to geo fields. Supports only equality conditions,
205205value should be specified as specific-shape array.
206206More information [ here] ( https://redis.io/docs/interact/search-and-query/query/geo-spatial/ )
207207``` php
208- use RedisVentures\PredisVl \Query\Filter\GeoFilter;
209- use RedisVentures\PredisVl \Enum\Condition;
210- use RedisVentures\PredisVl \Enum\Unit;
208+ use RedisVentures\RedisVl \Query\Filter\GeoFilter;
209+ use RedisVentures\RedisVl \Enum\Condition;
210+ use RedisVentures\RedisVl \Enum\Unit;
211211
212212$geo = new GeoFilter('geo', Condition::equal, [
213213 'lon' => 10.111,
@@ -223,11 +223,11 @@ To apply multiple filters to a single query use AggregateFilter.
223223If there's the same logical operator that should be applied for each filter you can pass values in constructor,
224224if you need a specific combination use ` and() ` and ` or() ` methods to create combined filter.
225225``` php
226- use RedisVentures\PredisVl \Query\Filter\AggregateFilter;
227- use RedisVentures\PredisVl \Query\Filter\TextFilter;
228- use RedisVentures\PredisVl \Query\Filter\NumericFilter;
229- use RedisVentures\PredisVl \Enum\Condition;
230- use RedisVentures\PredisVl \Enum\Logical;
226+ use RedisVentures\RedisVl \Query\Filter\AggregateFilter;
227+ use RedisVentures\RedisVl \Query\Filter\TextFilter;
228+ use RedisVentures\RedisVl \Query\Filter\NumericFilter;
229+ use RedisVentures\RedisVl \Enum\Condition;
230+ use RedisVentures\RedisVl \Enum\Logical;
231231
232232$aggregate = new AggregateFilter([
233233 new TextFilter('text', Condition::equal, 'value'),
@@ -254,7 +254,7 @@ The only required option is your API key specified as environment variable or co
254254
255255### OpenAI ###
256256``` php
257- use RedisVentures\PredisVl \Vectorizer\Factory;
257+ use RedisVentures\RedisVl \Vectorizer\Factory;
258258
259259putenv('OPENAI_API_TOKEN=your_token');
260260
@@ -274,7 +274,7 @@ When you perform vector queries against Redis or load hash data into index that
274274your vector should be represented as a blob string. VectorHelper allows you to create
275275blob representation from your vector represented as array of floats.
276276``` php
277- use RedisVentures\PredisVl \VectorHelper;
277+ use RedisVentures\RedisVl \VectorHelper;
278278
279279$blobVector = VectorHelper::toBytes([0.001, 0.002, 0.003]);
280280```
0 commit comments