<@U01NZ4D0LDD>, Is there any way to change the pat...
# community-help
k
@Jason Bosco, Is there any way to change the path from this to
<http://localhost:8108/multi_search?x-typesense-api-key=xyz>
this
<http://localhost:8108/typesense/multi_search?x-typesense-api-key=xyz>
Copy code
import TypesenseInstantsearchAdapter from "typesense-instantsearch-adapter";

let TYPESENSE_SERVER_CONFIG = {
  apiKey: "xyz", 
  nodes: [
    {
      host: "localhost",
      port: 8108,
      protocol: "http",
    },
  ],
  connectionTimeoutSeconds: 1,
  numRetries: 8,
};

export const typesenseAdapter = new TypesenseInstantsearchAdapter({
  server: TYPESENSE_SERVER_CONFIG,
  additionalSearchParameters: {
    query_by: "CAS_ID,Synonyms,Molecular_Weight",
    queryByWeights: "4,2,2",
    numTypos: 3,
    typoTokensThreshold: 1,
  },
});

export const searchClient = typesenseAdapter.searchClient;
above code, I wrote in next.js - typesenseadapter.js
j
You can update the nodes config to this:
Copy code
nodes: [
    {
      host: "localhost",
      path: "/typesense",
      port: 8108,
      protocol: "http",
    },
k
after adding the prop path I am getting an error - 400 { "message": "Not Found"}
j
Could you look at the browser’s network inspector and share the actual path being generated?
Wait do you already have Typesense running behind
<http://localhost:8108/typesense/>
via a reverse proxy?
k
I am trying on my local system Linux, and also 8108 port is running on my system
j
See our previous thread about first running Typesense on that path via a reverse proxy: https://typesense-community.slack.com/archives/C01P749MET0/p1679094420084709
Only once you have that working, will changing the config in the adapter work
k
Ok
I will try to repopulate the data with new configuration using typesense npm
@Jason Bosco how can I add a path to the typesense server configuration
j
Typesense does not support this natively
So it will only listen to the root path
You have to put nginx in front of Typesense if you want to serve from a sub-path