Robert
September 4, 2023, 9:59am
1
Error stack:
FetchError: request to https://https//bbb-328x3047.weaviate.network/v1/schema failed, reason: getaddrinfo EAI_AGAIN https
at ClientRequest. (/var/www/html/app/node_modules/node-fetch/lib/index.js:1505:11)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:502:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: ‘system’,
errno: ‘EAI_AGAIN’,
code: ‘EAI_AGAIN’
}
This is the only code I have.
const client = weaviate.client({
scheme: “https”,
host: “https://bbb-328x3047.weaviate.network ”,
apiKey: “API KEY”
});
const className = 'Question';
const classObj = {
class: className,
vectorizer: 'text2vec-openai',
};
let result = await client.schema.classCreator().withClass(classObj).do();
console.log(JSON.stringify(result, null, 2));
The step generating the error is the let result line. The client variable seems to be holding the db object.
I’m new to weaviate. If anyone has a working example of Javascript code with a connection to the database, adding a schema, and doing a simple search that would be great.
Thanks
Hi! Welcome to our community
The issue here is that you are providing the schema together with the hostname.
Try this:
const client = weaviate.client({
scheme: “https”,
host: “bbb-328x3047.weaviate.network”,
apiKey: “API KEY”
});
Let me know if this helps
Ah, and regarding examples, check out our examples repository:
# Weaviate examples
List of examples and tutorials of how to use the Vector Search Engine
Weaviate for cool machine-learning related tasks.
### Running Weaviate
* Most examples assume you have a Weaviate running. You can run one locally by following [this installation guide](https://weaviate.io/developers/weaviate/current/getting-started/installation.html#customize-your-weaviate-setup) in the documentation.
* If you need a specific vectorizer module or another ML module, it will be explained in the tutorial.
* Basic links: [Documentation](https://github.com/semi-technologies/weaviate) – [Github](https://weaviate.io/developers/weaviate/current/) - [Slack](https://weaviate.io/slack)
## Examples
|Title|Language|Description|
|---|---|---|
| [Semantic search through Wikipedia with the Weaviate vector search engine](https://github.com/semi-technologies/semantic-search-through-Wikipedia-with-Weaviate) | GraphQL | Semantic search through a vectorized Wikipedia (SentenceBERT) with the Weaviate vector search engine |
| [PyTorch-BigGraph Wikidata search with the Weaviate vector search engine](https://github.com/semi-technologies/biggraph-wikidata-search-with-weaviate) | GraphQL | Search through Facebook Research's PyTorch BigGraph Wikidata-dataset with the Weaviate vector search engine |
| [Multi-Modal Text/Image search using CLIP](clip-multi-modal-text-image-search/) | Bash, Javascript, React | Use text to search through images using CLIP (multi2vec-clip). Also acts as a demo on how to use Weaviate with React |
| [Google Colab notebook: Getting started with the Python Client](getting-started-with-python-client-colab) | python (Google Colab) | Google Colab notebook to learn to get started with the Python client. Contains plenty of example code. |
| [Demo dataset News Publications with Contextionary](weaviate-contextionary-newspublications) | yaml | Docker-compose configuration file of Weaviate with a News Publications demo dataset. |
This file has been truncated. show original