Skip to content

Commit

Permalink
Merge pull request #2926 from weaviate/docs/01-16-ts-examples
Browse files Browse the repository at this point in the history
Adding Examples to Documentation
  • Loading branch information
malgamves authored Jan 17, 2025
2 parents 96850d6 + 8cb329b commit 3d3f004
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 14 deletions.
2 changes: 1 addition & 1 deletion _includes/code/howto/manage-data.migrate.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ async function migrateData(collection_src: Collection, collection_tgt: Collectio

let objectToInsert = {
properties: item.properties,
vector: item.vectors.default,
vectors: item.vectors.default,
uuid: item.uuid,
}

Expand Down
9 changes: 8 additions & 1 deletion _includes/code/howto/search.aggregate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,14 @@ console.log(result.properties['points']);
// =========================================
{
// HybridExample
// TS client support coming soon
const jeopardy = client.collections.get("JeopardyQuestion")

const response = await jeopardy.aggregate.hybrid("animals in space", {
objectLimit: 10,
returnMetrics: jeopardy.metrics.aggregate("points").number(["sum"])
})

console.log("", response.properties['points'].sum)
// END HybridExample

// Test
Expand Down
4 changes: 2 additions & 2 deletions _includes/code/howto/search.hybrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ for (let object of result.objects) {
// VectorSimilarity

const result = await jeopardy.query.hybrid('California', {
maxVectorDistance: 0.4, // Maximum threshold for the vector search component
vector: {
query: 'large animal',
moveAway: { force: 0.5, concepts:['mamal', 'terrestrial'] }
moveAway: { force: 0.5, concepts:['mammal', 'terrestrial'] }
},
// maxVectorDistance support coming soon
alpha: 0.75,
limit: 5,

Expand Down
2 changes: 1 addition & 1 deletion blog/2025-01-15-hono-search-apis/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Building Search APIs with Hono.js'
title: 'Building AI Search APIs with Hono.js'
slug: hono-search-apis
description: "Master modern search capabilities by building a powerful API server with Hono.js. Learn how to implement vector, hybrid, and generative search while maintaining performance and reliability."
authors: [daniel]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ await client.collections.create({
],
// highlight-start
vectorizers: [
weaviate.configure.vectorizer.text2VecJina({
weaviate.configure.vectorizer.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
}),
Expand All @@ -571,7 +571,7 @@ await client.collections.create({
],
// highlight-start
vectorizers: [
weaviate.configure.vectorizer.text2VecJina({
weaviate.configure.vectorizer.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
model: 'jina-embeddings-v3'
Expand All @@ -595,9 +595,9 @@ await client.collections.create({
],
// highlight-start
vectorizers: [
weaviate.configure.vectorizer.text2VecJina({
weaviate.configure.vectorizer.text2VecJinaAI({
name: 'title_vector',
sourceProperties: ['title'],
sourceProperties: ['title'],
// model: 'jina-embeddings-v3-small-en'
// dimensions: 512, // e.g. 1024, 256, 64 Support for this parameter is coming soon (Only applicable for some models)
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"tailwindcss": "^3.2.7",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"weaviate-client": "^3.3.1",
"weaviate-client": "^3.3.4",
"weaviate-ts-client": "^2.2.0",
"weaviate-ts-embedded": "^1.2.0"
},
Expand Down
28 changes: 24 additions & 4 deletions src/components/Documentation/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,20 @@ const DocHomePage = () => {
<div className={`${styles.scenarioLogo} ${styles.data}`}></div>
<div className={styles.scenarioText}>
<span>
<a href="/developers/academy/py/starter_text_data/">
Work with text data
<span>
Work with text data
</span>
<span>
<p>
<a href="/developers/academy/py/starter_text_data/">
Python
</a> / <a href="/developers/academy/js/starter_text_data/">
JavaScript
</a>
</p>
</span>
</span>


<p>
Just bring your text data to Weaviate and it will do the rest.
Expand Down Expand Up @@ -200,7 +210,7 @@ const DocHomePage = () => {
<div className={`${styles.scenarioLogo} ${styles.custom}`}></div>
<div className={styles.scenarioText}>
<span>
<a href="/developers/academy/py/starter_custom_vectors">
<a href="/developers/weaviate/starter-guides/custom-vectors">
Bring your own vectors
</a>
</span>
Expand Down Expand Up @@ -230,10 +240,20 @@ const DocHomePage = () => {
<div className={`${styles.scenarioLogo} ${styles.semantic}`}></div>
<div className={styles.scenarioText}>
<span>
<a href="/developers/academy/py/starter_multimodal_data">
<span>
Multimodality
</span>
<span>
<p>
<a href="/developers/academy/py/starter_multimodal_data">
Python
</a> / <a href="/developers/academy/js/starter_multimodal_data">
JavaScript
</a>
</p>
</span>
</span>


<p>For many, data comes in multiple forms beyond text.</p>
<p>
Expand Down

0 comments on commit 3d3f004

Please sign in to comment.