#community-help

Querying Integer Fields in query_by

TLDR Saurabh wants to query an integer field in query_by. Kishore Nallan suggests indexing the field as a string instead to properly query it.

Powered by Struct AI
12
4mo
Solved
Join the chat
May 09, 2023 (4 months ago)
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
06:50 AM
Hey @all , I am getting the response as above, can anyone help me with It ?

Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:51 AM
Are you trying to use that field in query_by?
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
06:54 AM
Thanks for the reply Kishore Nallan, can you pls help me with it ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:55 AM
Happy to, can you please answer my question above.
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
06:56 AM
Yess , am using it in query_by
06:57
Saurabh
06:57 AM
Kishore Nallan
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
06:59 AM
Fields in query_by should be string fields. If you want to query on the contents of this field, index it as a string.
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
07:02 AM
q=15100&query_by=costs.avg_tuition_for_ug_usd&sort_by=sort_order:desc
07:02
Saurabh
07:02 AM
i neeed to query it on int value, what can I use alternative for it ?
07:11
Saurabh
07:11 AM
Kishore Nallan
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:21 AM
Create a string field and store content as string so you can query on that.
Saurabh
Photo of md5-57be9cd26696982f7dd2392eff28df99
Saurabh
07:21 AM
Ajay