-
Notifications
You must be signed in to change notification settings - Fork 10
why use PREFIX with create ? #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, You have 2 ways to set prefix(es), with the IndexBuilder/** @var \MacFJA\RediSearch\Redis\Client $client */
$builder = (new \MacFJA\RediSearch\IndexBuilder())
->setIndex('idx')
->setPrefixes(['blog:post:']) // Setter take an array
->addTextField('title')
->addTextField('body');
$builder->create($client); /** @var \MacFJA\RediSearch\Redis\Client $client */
$builder = (new \MacFJA\RediSearch\IndexBuilder())
->setIndex('idx')
->addPrefixes('blog:post:') // "Adder" take one or more arguments as prefixes
->addTextField('title')
->addTextField('body');
$builder->create($client); Create/** @var \MacFJA\RediSearch\Redis\Client $client */
$create = (new \MacFJA\RediSearch\Redis\Command\Create())
->setIndex('idx')
->setPrefixes('blog:post:')
->addTextField('title')
->addTextField('body');
$client->execute($create); I hope that answer your question. |
thanks,I will. But I need more operations, such as CRUD. or detailed function description |
This library is a "low-level" implementation. If you want more high level I can suggest macfja/redisearch-integration (git). But with only this library
|
Thanks a lot, I will already use 2.x. |
FT.CREATE idx ON HASH PREFIX 1 blog:post: SCHEMA,PREFIX ? how to use it create?
The text was updated successfully, but these errors were encountered: