Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geopoint doesn't accept the int as latitude and langitute #1712

Open
MutharasuArchunan13 opened this issue May 7, 2024 · 0 comments
Open

Comments

@MutharasuArchunan13
Copy link

Description:
In geopoint data type only accept the doesn't accept the integer values if i convert to float then only its work.so it not working properly why because latitude and langitude not always available only float values it available integer values also for example
valid geopoint --> [13,77.583333] but while i try to create document it throw error incorrect type if i typecast to float that time it work.

samples:
create_response = client.collections.create(
{
"name" : "auto_consult",
"enable_nested_fields":True,
"fields" : [
{
"name":"id",
"type":"int64"
},
{
"name":"brand",
"type":"string",
"optional":True
},
{
"name":"model",
"type":"string"
},
{
"name":"price",
"type":"int64"
},
{
"name":"color",
"type":"string"
},
{
"name": "experiences.id",
"type": "int64[]",
"index": True,
"sortable": True,
"optional": True,
},
{
"name": "experiences.designation",
"type": "string[]",
"optional": True,
},
{
"name": "experiences.company",
"type": "string[]",
"optional": True,
},
{
"name": "experiences.location",
"type": "geopoint[]",
"optional": True,
},
{
"name": "experiences.location_name",
"type": "string[]",
"optional": True,
},
{
"name": "experiences.start_date",
"type": "string[]",
"index": False,
"sortable": True,
"optional": True,
},
{
"name": "experiences.end_date",
"type": "string[]",
"index": False,
"sortable": True,
"optional": True,
},
],
"default_sorting_field" : "price"
}
)
document={
"id": "501","model": "RX100", "price": 150000, "color": "Red"
,'experiences': [{'id': 145285, 'designation': 'mechnic', 'company': 'tatamotor India', 'location': [13, 77.583333], 'location_name': 'Bangalore', 'start_date': 'March 2024', 'end_date': 'Present'}, {'id': 145286, 'designation': 'junior mechnic', 'company': 'Tata Services', 'location': [13, 77.583333], 'location_name': 'Bengaluru, Karnataka, India', 'start_date': 'May 2022', 'end_date': 'March 2024'}, {'id': 145287, 'designation': 'Senior Engineer', 'company': 'infiauto', 'location': [22.1991660760527, 78.476681027237], 'location_name': 'India', 'start_date': 'October 2021', 'end_date': 'May 2022'}, {'id': 145288, 'designation': 'System Engineer', 'company': 'tvs', 'location': [18.521428, 73.854454], 'location_name': 'Pune', 'start_date': 'September 2019', 'end_date': 'October 2021'}],
}
*error message *
typesense.exceptions.RequestMalformed: [Errno 400] Field experiences.location has an incorrect type.

Expected Behavior

It should accept the valid geopoint --> [13, 77.583333]

Actual Behavior

if i change the document -->
{'color': 'Red', 'experiences': [{'company': 'tatamotor India', 'designation': 'mechnic', 'end_date': 'Present', 'id': 145285, 'location': [13.0, 77.583333], 'location_name': 'Bangalore', 'start_date': 'March 2024'}, {'company': 'Tata Services', 'designation': 'junior mechnic', 'end_date': 'March 2024', 'id': 145286, 'location': [13.0, 77.583333], 'location_name': 'Bengaluru, Karnataka, India', 'start_date': 'May 2022'}, {'company': 'infiauto', 'designation': 'Senior Engineer', 'end_date': 'May 2022', 'id': 145287, 'location': [22.1991660760527, 78.476681027237], 'location_name': 'India', 'start_date': 'October 2021'}, {'company': 'tvs', 'designation': 'System Engineer', 'end_date': 'October 2021', 'id': 145288, 'location': [18.521428, 73.854454], 'location_name': 'Pune', 'start_date': 'September 2019'}], 'id': '501', 'model': 'RX100', 'price': 150000}
this is the output i changed as float so my question is are updated in new version else what is the issue ? for this i lost more data on my server.
i update v26.0 but still i'm facing this issue.

Metadata

Typesense Version:
v26.0
OS
ubuntu22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants