what can lead to this situation? before it was per...
# community-help
d
what can lead to this situation? before it was perfectly working on both environments
k
Can you please tell me what version you are using?
Or you can also DM me the cluster IDs
d
well, I use the very last for iOS: dependencies: [ .package(url: "https://github.com/typesense/typesense-swift", .upToNextMajor(from: "0.1.0"), ],
k
I mean the typesense server version
d
oh sorry
s
we are using
0.24.0
on dev and
0.24.1
on prod
I have requested update on dev cluster
perhaps that could be the issue
👍 1
Updated to latest version @deactivateduser can you check if that helped ?
d
ok hold
nope, same situation
k
Are you able to see the results on Typesense Cloud dashboard?
d
zero results in that specific collection
yes, on the backend it works perfectly
k
Are you maybe using an API key with embedded search params?
d
if I try to send a different query key, like "test" I get results without problems. Is only using "*" or empty like "" that does not produce anything
k
For e.g. an API key with a filter param that excludes results somehow.
d
the same very query works on prod server, but not on dev, so is not the query at all for my point of view
k
But API keys are different across environments.
Can you try making a raw http request in ios without using the Typesense client?
Just call it like this:
Copy code
<https://host_name/collections/food/documents/search?q=*&query_by=title&x-typesense-api-key=XXXXX>
s
We havent changed API key - and this key works fine on Android (the configs are shared)
It's just the search only key
Auto generated - this one has no special limitations - full search
k
It's really weird then. I mean if there is something wrong with the client then production should also be affected.
s
Yeah
@deactivateduser can you share code ?
k
If you can do a raw http request as suggested above, it should offer more evidence
👏 1
d
trying
one thing though: if I send
sort_by
or even
filter_by
, using "*" in dev works fine, I get results
let me try to do a raw call, 15 mins please
Ok, using that raw call, I get results
Copy code
{"facet_counts":[],"found":23640,"hits":[{"document":{"deleted":true,"fdcId":0,"foodBrandId":"String Value","foodCategories":["String ...
s
@Kishore Nallan ^
k
Ok to figure out what's happening, I need a reproduceable code snippet with a search only API key I can try with.
Please DM me. We will investigate and get back to you.
s
Ok sure I will send the API key in DM we are using
j
@Shaun Byrnes / @deactivateduser Could you also share the values for these parameters that you’re calling this method with:
Copy code
func retrieve<T>(_ queryKey: String,
                   collectionName: String,
                   queryBy: String,
                   filterBy: String? = nil,
                   sortBy: String? = nil,
                   page: Int = 1,
                   forModel: T.Type,
                   callback: @escaping ([SearchResultHit<T>]?) -> ())
👀 1
s
I will await @deactivateduser to share
d
@Jason Bosco Hello 🙋🏼‍♂️ I use simply this:
Copy code
_ = await retrieve("*",
                            collectionName: foodCollection,
                            queryBy: "name",
                            page: 1,
                            forModel: FirebaseFood.self) { [weak self] results in
        guard let _ = self else { return }
        guard let r = results else { return }
        
        food = r.compactMap { x in return x.document }
      }
in dev does not works but in prod it works, same cloned collections with exact the same structure and rules
I had to create a callback because the official Typesense framework does not have any queue to cancel the requests (I hope this feature will come soon btw)
j
@deactivateduser I’m a little stumped on what’s happening here… To summarize: • Raw curl requests work as expected across both dev and production • But the same equivalent swift code works in prod, but not in dev Given that curl works properly across envs, that rules out the possibility that this is a Typesense server-side issue. Given that the swift code works at least in one env, I’d imagine then the Swift library itself works fine. So my last suspicion is on how the config variables get passed into the swift code… Is there any chance that on dev somehow the wrong Typesense server is being used, one that doesn’t have the data in it?
d
the dev server just got updated to the last version sam as prod and now everything works
😅 1
so the problem was the version of the server with the version of the ios framework
this combination had some problems
The same queries were used in both environment, producing 2 different results: one with results, zero with the other.
k
Ok, so all good now?
d
yep
if this scenario will appear in the future I will ping you again
k
👍 Thanks for the details.