Duplicate facets inside the request #663
Comments
Thanks for reporting the issue. As mentioned in your message, this is tracked in algolia/instantsearch#3278 and comes from the InstantSearch.js connectors. We're aware on this problem and will try to make some time to fix this issue. In the mean time, did you try this solution? |
Sorry, but I do not understand the proposed solution. |
Hi @msassa, sorry about the delayed answer. We didn't find a proper solution to fix the issue yet inside Vue InstantSearch. The root of the issue come from an internal function of InstantSearch.js. It happens because the The only workaround we've found is to re-implement the import { createWidgetMixin } from 'vue-instantsearch';
import { connectConfigure } from 'instantsearch.js/es/connectors';
export default {
name: 'CustomConfigure',
mixins: [createWidgetMixin({ connector: connectConfigure })],
props: {
parameters: {
type: Object,
required: true,
},
},
computed: {
widgetParams() {
return {
searchParameters: this.parameters,
};
},
},
render() {
return null;
},
}; You can use it like this: <template>
<!-- ... -->
<custom-configure :parameters="parameters" />
</template>
<script>
export default {
data() {
return {
//...
parameters: {
hitsPerPage: 4
}
};
}
};
</script> Hope that helps, let us know if it fixes your issue or if you have any questions. |
Hi @samouss thank you so much for this help. |
Hi everyone, after add some new filters, like distance and zipcode, the problem appears again. |
We are very close to solving this issue. You can help us try it out if you build (yarn; yarn build; yarn pack) in InstantSearch.js and then install the created gz in your Vue InstantSearch project. Sorry that this has taken long. |
I have just released InstantSearch.js 3.6.0 with this fix. |
fixes #663 Confirmed this in: https://codesandbox.io/s/check-extra-request-higuj (you need to clone it, CodeSandbox doesn't deduplicate the dependency as expected)
* fix(core): prevent duplicating facet values fixes #663 Confirmed this in: https://codesandbox.io/s/check-extra-request-higuj (you need to clone it, CodeSandbox doesn't deduplicate the dependency as expected) * chore: update size
Vue InstantSearch 2.3.0 has this fix: https://codesandbox.io/s/check-extra-request-higuj |
Thank you so much @Haroenv |
Issue with duplicated requests when ais-configure component is used still exists :(. Workaround with custom configuration component don't work :/. "vue-instantsearch": "^3.4.2", |
…h#705) * fix(core): prevent duplicating facet values fixes algolia/vue-instantsearch#663 Confirmed this in: https://codesandbox.io/s/check-extra-request-higuj (you need to clone it, CodeSandbox doesn't deduplicate the dependency as expected) * chore: update size
Bug 🐞
What is the current behavior?
I posted a comment here algolia/instantsearch#3278 (comment)
And a post here https://discourse.algolia.com/t/ais-configure-cause-multiple-hit-to-algolia-api-doubling-the-facet-filter/7565
Simple showing or hidding a div cause multiple request to algolia api, and in every request the facets are duplicated.
Make a sandbox with the current behavior
What is the expected behavior?
No making extra request, and NOT duplicate de facet
Does this happen only in specific situations?
I think is only when I add the ais-configure, without this component doesn't happen
What is the version you are using?
The text was updated successfully, but these errors were encountered: