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

Search results not correct when using optimizers #6

Open
sambolek opened this issue May 10, 2022 · 4 comments
Open

Search results not correct when using optimizers #6

sambolek opened this issue May 10, 2022 · 4 comments

Comments

@sambolek
Copy link

sambolek commented May 10, 2022

Hi,

we're testing this module out but noticed the products returned are always the same. Upon further inspection with xdebug, I found that our query doesn't satisfy either condition here https://github.com/Web200/magento-elasticsuite-autocomplete/blob/main/src/module-elasticsuite-autocomplete/Model/Query/Product.php#L215 . It seems that our autocomplete query is of "functionScore" type.

We have tried setting "wildcard" to "true" and using your custom indices/analyzer configuration from readme, but in that case, we got the following error:
Exception #0 (Elasticsearch\Common\Exceptions\BadRequest400Exception): {"error":{"root_cause":[{"type":"parsing_exception","reason":"[function_score] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":1,"col":961}],"type":"parsing_exception","reason":"[function_score] malformed query, expected [END_OBJECT] but found [FIELD_NAME]","line":1,"col":961},"status":400}

Our optimizer configuration looks like this https://prnt.sc/l8bC5PYAxF6g

I'm checking further, but interested to know if you're using optimizers in any of your projects where this module is installed.

@julienanquetil
Copy link

Same issue here, I try by curiosity to see if there is any improvments on our setup, but unfortunalty got the error also.

@sambolek
Copy link
Author

For now we just disabled optimizers on autocomplete and left them on for other request types. Not ideal, but we like the speed improvements on autocomplete very much.
@kpitn could you please shed some light on the line mentioned above - what is happening inside "query" method?

@kpitn
Copy link
Contributor

kpitn commented May 19, 2022

I try to test query_string, but result are no so good.

I will try new wildcard field from elasticsearch 7.9+ https://www.elastic.co/guide/en/elasticsearch/reference/master/keyword.html#wildcard-field-type

Actually i remove all "wilcard" feature from this module.

@kpitn
Copy link
Contributor

kpitn commented Jun 23, 2022

@sambolek @julienanquetil

Can you test the last version, I introduce prefix search, you can active the option with Elasticsuite > Autocomplete > Product Autocomplete > Improve Search > Yes

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

3 participants