String vs Integer Indexing Performance
TLDR TJ inquired about performance differences between string and integer indexing. Jason explained it depends on the intended use of the field.
Powered by Struct AI
3
8mo
Solved
Mar 23, 2023 (8 months ago)
TJ
TJ
08:19 PMHello, is there any performance difference in searches when indexing a field as a string vs indexing it as an integer? I believe I saw a comment on a Github issue that string fields perform better but I can't find it
Jason
Jason
10:02 PMIt depends on how you want to use the field…
If you want to do full-text search on it (using the query_by parameter), indexing it as a string is the only option.
If you want to do full-text search on it (using the query_by parameter), indexing it as a string is the only option.
TJ
TJ
10:34 PMgot it, ty
Typesense
Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI
Indexed 3005 threads (79% resolved)
Similar Threads
Efficiency of Searching: String vs. String[]
Alan asked about the efficiency of using a string vs. string[] in a search query. Jason explained that it depends on the usage, but in their case, both should be nearly the same.
7
15mo
Solved
Query on Performance Impact Between String Array and String
Aljosa asked about performance differences between using a string array and a string. Kishore Nallan confirmed no significant impact, only minor memory overhead.
3
27mo
Solved
Querying Integer Fields in query_by
Saurabh wants to query an integer field in `query_by`. Kishore Nallan suggests indexing the field as a string instead to properly query it.
12
7mo
Solved