Skip to content
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

remaining FT.* commands - set FIRST_KEY_INDEX to 1 #2444

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/search/lib/commands/ALIASADD.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually 2 is incorrect as well, this should be executed on all shards (same for all alias commands)


export function transformArguments(name: string, index: string): Array<string> {
return ['FT.ALIASADD', name, index];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/ALIASDEL.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 2;

export function transformArguments(name: string, index: string): Array<string> {
return ['FT.ALIASDEL', name, index];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/ALIASUPDATE.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 2;

export function transformArguments(name: string, index: string): Array<string> {
return ['FT.ALIASUPDATE', name, index];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/ALTER.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { RediSearchSchema, pushSchema } from '.';

export const FIRST_KEY_INDEX = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RediSearch indexes should be created on all nodes (this should be removed)


export function transformArguments(index: string, schema: RediSearchSchema): Array<string> {
const args = ['FT.ALTER', index, 'SCHEMA', 'ADD'];
pushSchema(args, schema);
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/CONFIG_SET.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export function transformArguments(option: string, value: string): Array<string> {
return ['FT.CONFIG', 'SET', option, value];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/DROPINDEX.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

interface DropIndexOptions {
DD?: true;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/EXPLAIN.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Params, pushParamsArgs } from ".";

export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

interface ExplainOptions {
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/EXPLAINCLI.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

export function transformArguments(index: string, query: string): Array<string> {
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/INFO.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { RedisCommandArgument } from '@redis/client/dist/lib/commands';
import { transformTuplesReply } from '@redis/client/dist/lib/commands/generic-transformers';

export const FIRST_KEY_INDEX = 1;

export function transformArguments(index: string): Array<string> {
return ['FT.INFO', index];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/PROFILE_AGGREGATE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { pushAggregatehOptions, AggregateOptions, transformReply as transformAggregateReply, AggregateRawReply } from './AGGREGATE';
import { ProfileOptions, ProfileRawReply, ProfileReply, transformProfile } from '.';

export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

export function transformArguments(
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/PROFILE_SEARCH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { SearchOptions, SearchRawReply, transformReply as transformSearchReply }
import { pushSearchOptions, ProfileOptions, ProfileRawReply, ProfileReply, transformProfile } from '.';
import { RedisCommandArguments } from '@redis/client/dist/lib/commands';

export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

export function transformArguments(
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SPELLCHECK.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

interface SpellCheckTerms {
mode: 'INCLUDE' | 'EXCLUDE';
dictionary: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SUGADD.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

interface SugAddOptions {
INCR?: true;
PAYLOAD?: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SUGDEL.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export function transformArguments(key: string, string: string): Array<string> {
return ['FT.SUGDEL', key, string];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SUGGET.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

export interface SugGetOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/search/lib/commands/SUGGET_WITHPAYLOADS.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SugGetOptions, transformArguments as transformSugGetArguments } from './SUGGET';

export { IS_READ_ONLY } from './SUGGET';
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './SUGGET';

export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array<string> {
return [
Expand Down
2 changes: 1 addition & 1 deletion packages/search/lib/commands/SUGGET_WITHSCORES.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SugGetOptions, transformArguments as transformSugGetArguments } from './SUGGET';

export { IS_READ_ONLY } from './SUGGET';
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './SUGGET';

export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array<string> {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SugGetOptions, transformArguments as transformSugGetArguments } from '.
import { SuggestionWithPayload } from './SUGGET_WITHPAYLOADS';
import { SuggestionWithScores } from './SUGGET_WITHSCORES';

export { IS_READ_ONLY } from './SUGGET';
export { FIRST_KEY_INDEX, IS_READ_ONLY } from './SUGGET';

export function transformArguments(key: string, prefix: string, options?: SugGetOptions): Array<string> {
return [
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SUGLEN.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export const IS_READ_ONLY = true;

export function transformArguments(key: string): Array<string> {
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SYNDUMP.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export function transformArguments(index: string): Array<string> {
return ['FT.SYNDUMP', index];
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/SYNUPDATE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { pushVerdictArguments } from '@redis/client/dist/lib/commands/generic-transformers';
import { RedisCommandArguments } from '@redis/client/dist/lib/commands';

export const FIRST_KEY_INDEX = 1;

interface SynUpdateOptions {
SKIPINITIALSCAN?: true;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/search/lib/commands/TAGVALS.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export const FIRST_KEY_INDEX = 1;

export function transformArguments(index: string, fieldName: string): Array<string> {
return ['FT.TAGVALS', index, fieldName];
}
Expand Down