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

Error in json like attribute when updating to 2.5.0 #527

Closed
PhilipLund opened this issue Jun 2, 2021 · 3 comments
Closed

Error in json like attribute when updating to 2.5.0 #527

PhilipLund opened this issue Jun 2, 2021 · 3 comments

Comments

@PhilipLund
Copy link

PhilipLund commented Jun 2, 2021

  • Algolia Client Version: #.#.#
  • Language Version:

Description

When updating to version 2.5.0 from 2.4.0 data is missing from the searchHierachy attribute.
fetching the data using curl or looking at the Algolia dashboard shows that a product has several search hierarchies but when using the algoliasearch module version 2.5.0 only the first level is returned sometimes the first and the last level.

Steps To Reproduce

Comparing the output of a single search between version 2.4.0 and 2.5.0

Example

Expected response:
searchHierachy:
{
lvl0: [ "Husholdning" ]
lvl1: [ "Rengøring" ]
lvl2: [ "Rengøringsmidler" ]
lvl3: [ "Toilet og bad" ]
lvl4: [ "WC-rens" ]
lvl5: [ "Toiletrens" ]
}

Actual response:
searchHierachy:
{
lvl0: [ "Husholdning" ]
lvl5: [ "Toiletrens" ]
}

@shortcuts
Copy link
Member

Hey @PhilipLund,

Nothing should have changed on our side, I'll dig in our past commits to make sure I didn't missed anything.

only the first level is returned sometimes the first and the last level.

Do you mean results are inconsistent? Are you using the Async client?

In the meantime, could you please:

  • Try if you still encounter this issue in the 2.6.0 version
  • Provide a code snippet to reproduce the issue (to make sure we are testing in the same conditions)

Thanks!

@PhilipLund
Copy link
Author

Hey
This code will only return the first and last level.

`
from algoliasearch.search_client import SearchClient
import pandas as pd

cols = [
"objectID",
"inStock",
"searchHierachy",
"targetProductType",
]

client = SearchClient.create(application_id, api_key)
index = client.init_index(index_name)

records = []
for record in index.browse_objects({"query": "", "attributesToRetrieve": cols}):
records.append(record)

df = pd.DataFrame(records)
df["lenght"] = df["searchHierachy"].apply(lambda x: len(x.keys()))
cols = ["lenght", "searchHierachy"]
print(df.sort_values("lenght")[cols])
`
It is inconsistent from what is displayed on the algolia dashboard.
I am not using the Async client but have tried different versions (2.3.0, 2.4.0, 2.5.0, 2.6.0)

@shortcuts
Copy link
Member

Should not happen in v4

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

No branches or pull requests

2 participants