Do sphinx attributes have to perfectly match DB storage settings?

StackOverflow https://stackoverflow.com/questions/21582923

  •  07-10-2022
  •  | 
  •  

Вопрос

If I have a field in my table called sortingfield and it is stored as a BIGINT(20) unsigned.

Does it have to be called as an attribute in a way that exactly matches it's storage method?

Or can it just be called like this:

 sql_attr_uint = sortingfield

Or does it have to be

 sql_attr_bigint = sortingfield

Or does the field in the DB have to be changed to signed?

Currently I am trying to sort on the field and it is not sorting.

So, to sum up again, does the way you call the attribute have to exactly match

Это было полезно?

Решение

No they dont have to exactly match. Everything gets transfered as strings anyway, so type conversion is going on.

You just need to beware of out of range numbers.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top