-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from nameczz/dev
Fix binary vector when query data and disable multiple vector fields when create collection
- Loading branch information
Showing
8 changed files
with
79 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ node_modules | |
|
||
# testing | ||
/clientcoverage | ||
/client/vectors.csv | ||
**/vectors.csv | ||
|
||
# production | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createObjectCsvWriter as createCsvWriter } from 'csv-writer'; | ||
|
||
// use to test vector insert | ||
const csvWriter = createCsvWriter({ | ||
path: './vectors.csv', | ||
header: [{ id: 'vector', title: 'vector' }], | ||
}); | ||
|
||
const records = []; | ||
|
||
const generateVector = (dimension: number) => { | ||
let index = 0; | ||
const vectors = []; | ||
while (index < dimension) { | ||
vectors.push(1 + Math.random()); | ||
index++; | ||
} | ||
return JSON.stringify(vectors); | ||
}; | ||
|
||
while (records.length < 50000) { | ||
const value = generateVector(8); | ||
records.push({ vector: value }); | ||
} | ||
|
||
csvWriter | ||
.writeRecords(records) // returns a promise | ||
.then(() => { | ||
console.log('...Done'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters