<@U01PL2YSG8L> :tada::+1: :grin:
# community-help
t
@Kishore Nallan 🎉👍 😁
@Kishore Nallan can we try these with latest RC build?
k
👋 I was about to ping you later today. Closing out a few nice-to-have-s!
t
Ok, waiting for a ping then thanks 😄
👍 1
k
@Tugay Karaçay I've commented on the earlier gist with the details: https://gist.github.com/jasonbosco/c712b52a4b29e84ebce82c9a5ec82ffc
t
Thanks @Kishore Nallan We will try it ASAP 👍
Hi @Kishore Nallan will there be any performance gain if we define
facet: true
but
index: false
for a field? For example:
Copy code
{ "name": "brandId", "type": "string", "facet": true, "index": false, "optional": true }
or 
{ "name": ".*_fct", "type": "string", "facet": true, "index": false}
k
Once you do
index: false
it essentially amounts to the field being ignored totally. So facet indexing will not happen if
index
is set to
false
.
t
Oh I see, I totally misunderstood the
index: false
usage thanks.
k
👍 Let me know if you run into any gotchas.
t
Ok I have two questions if you have time?
k
Yes
t
1. Why applying multiple filters affects response time dramatically?
2. Is it possible to add found document count to search result to create pagination?
As we tested hits shows all search criteria hit count and this may be more than 1 for a document
k
1. It is probably because as you add more and more filters for a prefix search, it becomes harder and harder to find enough results (especially to satisfy
typo_tokens_threshold)
so the search has to become really exhaustive and that takes longer. The intersections of matching IDs of each of those filters will also take time with so many filters. 2. I don't quite follow this question, but there is a
found
field returned in search response.
t
I don’t quite follow this question, but there is a 
found
 field returned in search response.
For example we have an
int[]
field if we apply filter
1<= x <=4
and if field value is
[1,2,3,4,5]
then search result returns
found: 4
but actual document count is 1 in this case.
k
That's not how the
found
is expected to work. I just tried it on an array field on a single document and it is not showing that behavior:
Copy code
curl "<http://localhost:8108/collections/companies/documents>" -X POST -H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{
    "company_name": "Stark Industries",
    "num_employees": 5215,
    "category_fct": "defence", "values": [1,2,3,4,5],
    "description_text": "Some text that will not be indexed."
}'
{"category_fct":"defence","company_name":"Stark Industries","description_text":"Some text that will not be indexed.","id":"1","num_employees":5215,"values":[1,2,3,4,5]}

curl "<http://localhost:8108/collections/companies/documents/search?q=stark&query_by=company_name&filter_by=values>:>2&x-typesense-api-key=abcd&prefix=false"
{"facet_counts":[],"found":1,"hits":[{"document":{"category_fct":"defence","company_name":"Stark Industries","description_text":"Some text that will not be indexed.","id":"1","num_employees":5215,"values":[1,2,3,4,5]},"highlights":[{"field":"company_name","matched_tokens":["Stark"],"snippet":"<mark>Stark</mark> Industries"}],"text_match":130816}],"out_of":2,"page":1,"request_params":{"collection_name":"companies","per_page":10,"q":"stark"},"search_time_ms":1}
t
Hmm ok I will try to recreate this scenario 👍
Untitled
I think there is a bug when there are multiple documents matches the filter
k
Okay, I can reproduce. I will take a look.
It's only an issue with a wildcard query + filter, which is why it "worked" in my earlier example.
👍 1
Fixed in
typesense/typesense:0.20.0.rc18
t
Thank you! 😁