This message was deleted.
# community-help
s
This message was deleted.
j
number_hits is not a Typesense param…
r
so , is this the number of record stored on for my particular collection
j
num_documents in the collection schema is indeed the number of records stored in that particular collection
r
got it . and can you please confirm is this is the curl for generating only search access
curl 'http://localhost:8108/keys' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{"description":"Admin key.","actions": ["*"], "collections": ["*"]}'
j
No that’s an admin key
r
I am creating key with this curl
curl 'http://localhost:8108/keys' -X POST -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \
-H 'Content-Type: application/json' \
-d '{"description":"Search-only companies key.","actions": ["documents:search"], "collections": ["companies"]}'
but it won't for me , getting
j
That sounds like a networking problem. The browser is unable to connect to the Typesense server. It’s unrelated to api keys
r
Now I am getting
j
In your first screenshot I saw a different collection name. If that’s the collection you’re trying to search, you want to generate an API key with that collection name. The last code snippet you shared above has the collection name as “companies”, which is why it’s not working
r
no the curl was just demo . I updated the curl with our requirements
the 1st image of the thread is the collection name
j
To isolate the issue, could you give me a set of steps like this that reproduces the issue: https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b That spins up an empty Typesense server, makes an api call to create a key and then uses that key to do a search?
r
what does the error means you can check the health for typesense here https://docs.juspay.in/typesense/health
j
If you look at the response body in the network tab in the browser tab, you’ll see the cause of the 404. If it just says not found, it’s likely the collection name is not found
r
can You please check here what's the issue https://docs.juspay.in/blog/docs/overview/getting-started
I can see the collection from collection API
is typesense host support in the / format ? my typesense host is
'docs.juspay.in/typesense'
j
You want to use the
path
config like this:
Copy code
{
      host: "docs.juspay.in",
      port: "443",
      protocol: "https",
      path: '/typesense'
    }
r
my typesense host in
docs.juspay.in/typesense'
and I am using like
Copy code
typesenseServerConfig: {
            nodes: [
              {
                host: 'docs.juspay.in/typesense',
                port: 443,
                protocol: https
              }
            ],
            apiKey: searchOnlyApiKey
          },
beacuse i have the collection whatever we search . but can't able to call from frontend JS . is the cause for my host like
docs.juspay.in/typesense'
. is that then how I am call from frontend for this host
j
host has to be just the hostname “docs.justpay.in”
Copy code
typesenseServerConfig: {
            nodes: [
              {
                host: 'docs.juspay.in',
                port: 443,
                protocol: 'https',
                path: '/typesense'
              }
            ],
            apiKey: searchOnlyApiKey
          },
r
ok let me try
if path is empty then can it be cause any issue
j
Path is optional
r
ok
hey @Jason Bosco thank you so much it's working now
👍 1