enterprise-search-python icon indicating copy to clipboard operation
enterprise-search-python copied to clipboard

Bug: `boost` instead of `boosts` in search()

Open Venkat2811 opened this issue 3 years ago • 1 comments

As per elastic app-search api docs, boosts is the correct param.

However in this client, we have boost. https://github.com/elastic/enterprise-search-python/blob/main/elastic_enterprise_search/_sync/client/app_search.py#L2324

https://github.com/elastic/enterprise-search-python/blob/main/elastic_enterprise_search/_async/client/app_search.py#L2324

and in few other places. This results in the below error.

 line 249, in perform_request
    raise _HTTP_EXCEPTIONS.get(resp.meta.status, ApiError)(
elastic_enterprise_search.exceptions.BadRequestError: [400] {'errors': ['Options contains invalid key: boost']}

Venkat2811 avatar Sep 06 '22 05:09 Venkat2811

Thanks for reporting this, I believe this is an issue with how the client is generated, I'll get this fixed there and then close this issue afterwards.

sethmlarson avatar Sep 08 '22 13:09 sethmlarson

@sethmlarson, I have the same issue using the boosts params. Any idea when this can be fixed ? 🙏 Could you confirm using search([...], boosts) will change boosts setting for this query only ? An ad hoc solution I found is to use put_search_settings([...] boosts) but it will change boosts for the whole engine.

benoit360l avatar Feb 20 '23 16:02 benoit360l

Hello, please change https://github.com/elastic/enterprise-search-python/blob/main/elastic_enterprise_search/_sync/client/app_search.py#L2364 to "boosts" and anywhere else you need to. The entire API is borked when trying to use boosts as override to the current Engine settings.

groeney avatar Oct 02 '23 00:10 groeney

PTAL https://github.com/elastic/enterprise-search-python/pull/174

groeney avatar Oct 02 '23 00:10 groeney

Fixed in https://github.com/elastic/enterprise-search-python/pull/175 and released in https://pypi.org/project/elastic-enterprise-search/8.10.0/. Thank you for your patience, closing.

pquentin avatar Nov 13 '23 11:11 pquentin