Skip to content

Commit 4e7d5b6

Browse files
committed
Rename to Hyperscale
1 parent 79ae80d commit 4e7d5b6

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

libs/langchain-community/src/vectorstores/couchbase_query.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export enum DistanceStrategy {
2121

2222
export enum IndexType {
2323
COMPOSITE = "composite",
24-
BHIVE = "bhive",
24+
HYPERSCALE = "hyperscale",
2525
}
2626

2727
/**
@@ -536,7 +536,7 @@ export class CouchbaseQueryVectorStore extends VectorStore {
536536
* Create a new vector index for the Query vector store.
537537
*
538538
* @param options - Configuration options for creating the index
539-
* @param options.indexType - Type of the index (BHIVE or COMPOSITE) to create
539+
* @param options.indexType - Type of the index (HYPERSCALE or COMPOSITE) to create
540540
* @param options.indexDescription - Description of the index like "IVF,SQ8"
541541
* @param options.distanceMetric - Distance metric to use for the index. Defaults to the distance metric in the constructor
542542
* @param options.indexName - Name of the index to create. Defaults to "langchain_{indexType}_query_index"
@@ -626,9 +626,9 @@ export class CouchbaseQueryVectorStore extends VectorStore {
626626
let indexQuery: string;
627627
let finalIndexName: string;
628628

629-
if (indexType === IndexType.BHIVE) {
630-
finalIndexName = indexName || "langchain_bhive_query_index";
631-
// BHIVE: Specialized vector index with INCLUDE clause for additional fields
629+
if (indexType === IndexType.HYPERSCALE) {
630+
finalIndexName = indexName || "langchain_hyperscale_query_index";
631+
// HYPERSCALE: Specialized vector index with INCLUDE clause for additional fields
632632
indexQuery =
633633
`CREATE VECTOR INDEX \`${finalIndexName}\` ON \`${this.bucketName}\`.\`${this.scopeName}\`.\`${this.collectionName}\` ` +
634634
`(\`${vectorFieldName}\` VECTOR) INCLUDE (${includeFields

libs/langchain-community/src/vectorstores/tests/couchbase_query.test.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import {
2323
describe.skip("CouchbaseQueryVectorStore", () => {
2424
// Configuration
2525
const config = {
26+
// **Note** user must have permissions to create buckets and indexes, and must be able to flush buckets
27+
// unfortunately, Couchbase Capella doesn't support this level of access for database users,
28+
// so these tests must run against a local Couchbase server
2629
cluster: process.env.COUCHBASE_CLUSTER || "couchbase://localhost",
2730
username: process.env.COUCHBASE_USERNAME || "Administrator",
2831
password: process.env.COUCHBASE_PASSWORD || "password",
@@ -390,12 +393,12 @@ describe.skip("CouchbaseQueryVectorStore", () => {
390393
}
391394
}
392395

393-
test("should create BHIVE vector index", async () => {
394-
const createBhiveIndexOptions = {
395-
indexType: IndexType.BHIVE,
396+
test("should create HYPERSCALE vector index", async () => {
397+
const createHyperscaleIndexOptions = {
398+
indexType: IndexType.HYPERSCALE,
396399
indexDescription: "IVF1024,SQ8",
397400
distanceMetric: DistanceStrategy.COSINE,
398-
indexName: "my_bhive_vector_index",
401+
indexName: "my_hyperscale_vector_index",
399402
vectorDimension: 1536,
400403
fields: ["text", "metadata"],
401404
whereClause: "metadata.source = 'bulk_test'",
@@ -405,15 +408,15 @@ describe.skip("CouchbaseQueryVectorStore", () => {
405408

406409
// Test that createIndex doesn't throw an error
407410
await expect(
408-
indexTestStore.createIndex(createBhiveIndexOptions)
411+
indexTestStore.createIndex(createHyperscaleIndexOptions)
409412
).resolves.not.toThrow();
410413

411414
const indexes = await cluster
412415
.queryIndexes()
413416
.getAllIndexes(config.indexTestBucketName);
414417
expect(
415418
indexes.some(
416-
(index) => index.name === createBhiveIndexOptions.indexName
419+
(index) => index.name === createHyperscaleIndexOptions.indexName
417420
)
418421
).toBe(true);
419422
});
@@ -448,7 +451,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
448451

449452
test("should create index with minimal options", async () => {
450453
const minimalOptions = {
451-
indexType: IndexType.BHIVE,
454+
indexType: IndexType.HYPERSCALE,
452455
indexDescription: "IVF,SQ8",
453456
indexName: "minimal_options_index",
454457
whereClause: "metadata.source = 'bulk_test'",
@@ -469,7 +472,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
469472

470473
test("should auto-detect vector dimension from embeddings", async () => {
471474
const optionsWithoutDimension = {
472-
indexType: IndexType.BHIVE,
475+
indexType: IndexType.HYPERSCALE,
473476
indexDescription: "IVF,SQ8",
474477
indexName: "auto_dimension_index",
475478
whereClause: "metadata.source = 'bulk_test'",
@@ -492,7 +495,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
492495

493496
test("should handle index creation errors gracefully", async () => {
494497
const invalidOptions = {
495-
indexType: IndexType.BHIVE,
498+
indexType: IndexType.HYPERSCALE,
496499
indexDescription: "", // Empty description should cause an error
497500
indexName: "invalid_index",
498501
};
@@ -510,12 +513,12 @@ describe.skip("CouchbaseQueryVectorStore", () => {
510513
).toBe(false);
511514
});
512515

513-
test("should create both BHIVE and COMPOSITE indexes sequentially", async () => {
514-
const createBhiveIndexOptions = {
515-
indexType: IndexType.BHIVE,
516+
test("should create both HYPERSCALE and COMPOSITE indexes sequentially", async () => {
517+
const createHyperscaleIndexOptions = {
518+
indexType: IndexType.HYPERSCALE,
516519
indexDescription: "IVF1024,SQ8",
517520
distanceMetric: DistanceStrategy.COSINE,
518-
indexName: "sequential_bhive_index",
521+
indexName: "sequential_hyperscale_index",
519522
whereClause: "metadata.source = 'bulk_test'",
520523
};
521524

@@ -529,7 +532,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
529532

530533
// Test creating both index types sequentially
531534
await expect(
532-
indexTestStore.createIndex(createBhiveIndexOptions)
535+
indexTestStore.createIndex(createHyperscaleIndexOptions)
533536
).resolves.not.toThrow();
534537
await expect(
535538
indexTestStore.createIndex(createCompositeIndexOptions)
@@ -540,7 +543,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
540543
.getAllIndexes(config.indexTestBucketName);
541544
expect(
542545
indexes.some(
543-
(index) => index.name === createBhiveIndexOptions.indexName
546+
(index) => index.name === createHyperscaleIndexOptions.indexName
544547
)
545548
).toBe(true);
546549
expect(
@@ -552,7 +555,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
552555

553556
test("should use default distance strategy when not specified", async () => {
554557
const optionsWithoutDistance = {
555-
indexType: IndexType.BHIVE,
558+
indexType: IndexType.HYPERSCALE,
556559
indexDescription: "IVF,SQ8",
557560
indexName: "default_distance_index",
558561
whereClause: "metadata.source = 'bulk_test'",
@@ -583,7 +586,7 @@ describe.skip("CouchbaseQueryVectorStore", () => {
583586

584587
for (let i = 0; i < distanceStrategies.length; i += 1) {
585588
const options = {
586-
indexType: IndexType.BHIVE,
589+
indexType: IndexType.HYPERSCALE,
587590
indexDescription: "IVF,SQ8",
588591
distanceMetric: distanceStrategies[i],
589592
indexName: `distance_test_index_${i}`,

0 commit comments

Comments
 (0)