Skip to content

Commit

Permalink
localhost -> 127.0.0.1 to force use of ipv4
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbosco committed Apr 1, 2024
1 parent 6a2774c commit 503043f
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 55 deletions.
22 changes: 11 additions & 11 deletions doc/examples/server/aliases.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/bulkImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}, // ,
Expand Down
22 changes: 11 additions & 11 deletions doc/examples/server/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
12 changes: 6 additions & 6 deletions doc/examples/server/documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}, // ,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/errorHandling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
6 changes: 3 additions & 3 deletions doc/examples/server/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const masterApiKey = "xyz";
const typesense = new Typesense.Client({
nodes: [
{
host: "localhost",
host: "127.0.0.1",
port: "8108",
protocol: "http",
},
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -130,7 +130,7 @@ async function runExample() {
const scopedTypesenseClient = new Typesense.Client({
nodes: [
{
host: "localhost",
host: "127.0.0.1",
port: "8108",
protocol: "http",
},
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/operations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
26 changes: 13 additions & 13 deletions doc/examples/server/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/querySuggestions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const masterApiKey = "xyz";
const typesense = new Typesense.Client({
nodes: [
{
host: "localhost",
host: "127.0.0.1",
port: "8108",
protocol: "http",
},
Expand Down
3 changes: 2 additions & 1 deletion doc/examples/server/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -128,6 +128,7 @@ async function runExample() {
.search({
q: "Stark",
query_by: "company_name",
facet_by: "country",
});
console.log(searchResults);

Expand Down
2 changes: 1 addition & 1 deletion doc/examples/server/stopwords.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down
6 changes: 3 additions & 3 deletions doc/examples/server/synonyms.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 503043f

Please sign in to comment.