diff --git a/doc/examples/server/aliases.js b/doc/examples/server/aliases.js index ea746893..1b4388e4 100644 --- a/doc/examples/server/aliases.js +++ b/doc/examples/server/aliases.js @@ -11,20 +11,20 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, - { - host: "localhost", - port: "7108", - protocol: "http", - }, - { - host: "localhost", - port: "9108", - protocol: "http", - }, + // { + // host: "localhost", + // port: "7108", + // protocol: "http", + // }, + // { + // host: "localhost", + // port: "9108", + // protocol: "http", + // }, ], apiKey: "xyz", numRetries: 3, // A total of 4 tries (1 original try + 3 retries) diff --git a/doc/examples/server/bulkImport.js b/doc/examples/server/bulkImport.js index 222eb848..28668150 100644 --- a/doc/examples/server/bulkImport.js +++ b/doc/examples/server/bulkImport.js @@ -12,7 +12,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, // , diff --git a/doc/examples/server/collections.js b/doc/examples/server/collections.js index 14e223df..c0384840 100644 --- a/doc/examples/server/collections.js +++ b/doc/examples/server/collections.js @@ -11,20 +11,20 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, - { - host: "localhost", - port: "7108", - protocol: "http", - }, - { - host: "localhost", - port: "9108", - protocol: "http", - }, + // { + // host: "localhost", + // port: "7108", + // protocol: "http", + // }, + // { + // host: "localhost", + // port: "9108", + // protocol: "http", + // }, ], apiKey: "xyz", numRetries: 3, // A total of 4 tries (1 original try + 3 retries) diff --git a/doc/examples/server/conversations.js b/doc/examples/server/conversations.js index d0298fed..0ff9369d 100644 --- a/doc/examples/server/conversations.js +++ b/doc/examples/server/conversations.js @@ -11,7 +11,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/documents.js b/doc/examples/server/documents.js index e77eaa75..f4fb9aef 100644 --- a/doc/examples/server/documents.js +++ b/doc/examples/server/documents.js @@ -11,7 +11,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, // , @@ -124,11 +124,11 @@ async function runExample() { console.log(result); // update by query - console.log("Updating by query") - result = await typesense.collections("companies").documents().update( - { num_employees: 200}, - { filter_by: 'num_employees:>5000' } - ); + console.log("Updating by query"); + result = await typesense + .collections("companies") + .documents() + .update({ num_employees: 200 }, { filter_by: "num_employees:>5000" }); console.log(result); // Export all documents in a collection in JSON Lines format diff --git a/doc/examples/server/documents.ts b/doc/examples/server/documents.ts index 906403b1..3d2d9a1d 100644 --- a/doc/examples/server/documents.ts +++ b/doc/examples/server/documents.ts @@ -14,7 +14,7 @@ import { Client } from "../../../src/Typesense"; const typesense = new Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: 8108, protocol: "http", } as NodeConfiguration, diff --git a/doc/examples/server/errorHandling.js b/doc/examples/server/errorHandling.js index edf05311..d544cdfb 100644 --- a/doc/examples/server/errorHandling.js +++ b/doc/examples/server/errorHandling.js @@ -12,7 +12,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/keys.js b/doc/examples/server/keys.js index bf99a2d8..50eec129 100644 --- a/doc/examples/server/keys.js +++ b/doc/examples/server/keys.js @@ -13,7 +13,7 @@ const masterApiKey = "xyz"; const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, @@ -93,7 +93,7 @@ async function runExample() { await Promise.all( documents.map((document) => { return typesense.collections("users").documents().create(document); - }) + }), ); // Generate an API key and restrict it to only allow searches @@ -130,7 +130,7 @@ async function runExample() { const scopedTypesenseClient = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/operations.js b/doc/examples/server/operations.js index b7f8c044..cbedb4f3 100644 --- a/doc/examples/server/operations.js +++ b/doc/examples/server/operations.js @@ -11,7 +11,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/overrides.js b/doc/examples/server/overrides.js index beb491cc..c32fe5e4 100644 --- a/doc/examples/server/overrides.js +++ b/doc/examples/server/overrides.js @@ -11,20 +11,20 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, - { - host: "localhost", - port: "7108", - protocol: "http", - }, - { - host: "localhost", - port: "9108", - protocol: "http", - }, + // { + // host: "localhost", + // port: "7108", + // protocol: "http", + // }, + // { + // host: "localhost", + // port: "9108", + // protocol: "http", + // }, ], apiKey: "xyz", numRetries: 3, // A total of 4 tries (1 original try + 3 retries) @@ -99,8 +99,8 @@ async function runExample() { // create a couple of documents await Promise.all( documents.map((document) => - typesense.collections("companies").documents().create(document) - ) + typesense.collections("companies").documents().create(document), + ), ); // Create an override diff --git a/doc/examples/server/querySuggestions.mjs b/doc/examples/server/querySuggestions.mjs index 7ddb2805..32580266 100644 --- a/doc/examples/server/querySuggestions.mjs +++ b/doc/examples/server/querySuggestions.mjs @@ -15,7 +15,7 @@ const masterApiKey = "xyz"; const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/search.js b/doc/examples/server/search.js index 647f66cb..a3466ef2 100644 --- a/doc/examples/server/search.js +++ b/doc/examples/server/search.js @@ -17,7 +17,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, @@ -128,6 +128,7 @@ async function runExample() { .search({ q: "Stark", query_by: "company_name", + facet_by: "country", }); console.log(searchResults); diff --git a/doc/examples/server/stopwords.mjs b/doc/examples/server/stopwords.mjs index dc0fd902..043e0033 100644 --- a/doc/examples/server/stopwords.mjs +++ b/doc/examples/server/stopwords.mjs @@ -13,7 +13,7 @@ import Typesense from "../../../lib/Typesense.js"; const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, diff --git a/doc/examples/server/synonyms.js b/doc/examples/server/synonyms.js index 2f8b8655..81dceb79 100644 --- a/doc/examples/server/synonyms.js +++ b/doc/examples/server/synonyms.js @@ -11,7 +11,7 @@ const Typesense = require("../../../lib/Typesense"); const typesense = new Typesense.Client({ nodes: [ { - host: "localhost", + host: "127.0.0.1", port: "8108", protocol: "http", }, @@ -89,8 +89,8 @@ async function runExample() { // create a couple of documents await Promise.all( documents.map((document) => - typesense.collections("companies").documents().create(document) - ) + typesense.collections("companies").documents().create(document), + ), ); // Create a multi-way synonym