Skip to content

Commit

Permalink
Remove FUlltextIndex types
Browse files Browse the repository at this point in the history
  • Loading branch information
pluma4345 committed Apr 16, 2024
1 parent 9414b1c commit b416a4c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 71 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ for upgrading your code to arangojs v9.
types but most public methods still accept the equivalent `Record` types for
convenience.

- Removed `FulltextIndex` and related types

Fulltext indexes have been deprecated in ArangoDB 3.10 and should be replaced
with ArangoSearch.

### Changed

- Replaced request logic with native `fetch` API
Expand Down
26 changes: 0 additions & 26 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ import {
} from "./documents.js";
import { HttpError, isArangoError } from "./error.js";
import {
EnsureFulltextIndexOptions,
EnsureGeoIndexOptions,
EnsureInvertedIndexOptions,
EnsurePersistentIndexOptions,
EnsureTtlIndexOptions,
EnsureMdiIndexOptions,
FulltextIndex,
GeoIndex,
Index,
IndexSelector,
Expand Down Expand Up @@ -2658,29 +2656,6 @@ export interface DocumentCollection<T extends Record<string, any> = any>
ensureIndex(
details: EnsureMdiIndexOptions
): Promise<ArangoApiResponse<MdiIndex & { isNewlyCreated: boolean }>>;
/**
* Creates a fulltext index on the collection if it does not already exist.
*
* @param details - Options for creating the fulltext index.
*
* @deprecated Fulltext indexes have been deprecated in ArangoDB 3.10 and
* should be replaced with ArangoSearch.
*
* @example
* ```js
* const db = new Database();
* const collection = db.collection("some-collection");
* // Create a fulltext index for tokens longer than or equal to 3 characters
* await collection.ensureIndex({
* type: "fulltext",
* fields: ["description"],
* minLength: 3
* });
* ```
*/
ensureIndex(
details: EnsureFulltextIndexOptions
): Promise<ArangoApiResponse<FulltextIndex & { isNewlyCreated: boolean }>>;
/**
* Creates a geo index on the collection if it does not already exist.
*
Expand Down Expand Up @@ -4206,7 +4181,6 @@ export class Collection<T extends Record<string, any> = any>
options:
| EnsurePersistentIndexOptions
| EnsureGeoIndexOptions
| EnsureFulltextIndexOptions
| EnsureTtlIndexOptions
| EnsureMdiIndexOptions
| EnsureInvertedIndexOptions
Expand Down
45 changes: 0 additions & 45 deletions src/indexes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,38 +157,6 @@ export type EnsureGeoIndexOptions =
inBackground?: boolean;
};

/**
* Options for creating a fulltext index.
*
* @deprecated Fulltext indexes have been deprecated in ArangoDB 3.10 and
* should be replaced with ArangoSearch.
*/
export type EnsureFulltextIndexOptions = {
/**
* Type of this index.
*/
type: "fulltext";
/**
* An array containing exactly one attribute path.
*/
fields: [string];
/**
* A unique name for this index.
*/
name?: string;
/**
* Minimum character length of words to index.
*/
minLength?: number;
/**
* If set to `true`, the index will be created in the background to reduce
* the write-lock duration for the collection during index creation.
*
* Default: `false`
*/
inBackground?: boolean;
};

/**
* Options for creating a TTL index.
*/
Expand Down Expand Up @@ -594,18 +562,6 @@ export type PrimaryIndex = GenericIndex & {
selectivityEstimate: number;
};

/**
* An object representing a fulltext index.
*
* @deprecated Fulltext indexes have been deprecated in ArangoDB 3.10 and
* should be replaced with ArangoSearch.
*/
export type FulltextIndex = GenericIndex & {
type: "fulltext";
fields: [string];
minLength: number;
};

/**
* An object representing a geo index.
*/
Expand Down Expand Up @@ -701,7 +657,6 @@ export type InvertedIndex = GenericIndex & {
*/
export type Index =
| GeoIndex
| FulltextIndex
| PersistentIndex
| PrimaryIndex
| TtlIndex
Expand Down

0 comments on commit b416a4c

Please sign in to comment.