feat: initial-refinement #139
Comments
Hey @julienbourdeau , I think you raised this point. |
Well, I'm not sure what I said earlier but I have one thing in mind right now. I would like to be able to define a template for the refinement list. So for example, I could have color circle for faceting the color, instead of a list of checkboxes. Is it what we talked about? |
No, it was not what you talked about I think, because I just remembered your initial issue thanks to your answer 馃槀 . |
Oh yeah! I remember now :D |
Hi there. tia |
With the version 1 it's not possible, with the version 2 (currently in beta) there is no built-in way but you can use the <template>
<ais-instant-search [...]>
<ais-configure v-bind="initial"/>
<ais-refinement-list attribute="brand"/>
</ais-instant-search>
</template>
<script>
export default {
data() {
return {
initial: {
disjunctiveFacetsRefinements: {
brand: ["Apple"]
}
}
};
},
};
</script> |
This totally worked for me. |
Yep, menu & hierarchical menu uses hierarchicalFacetsRefinements; refinement list uses disjunctiveFacetsRefinements. Rating and numerical menu use numericalFacetsRefinements |
hi , the workaround provided by @samouss works but how to prevent initial refinements from getting re-apply every-time an item in refinements changes. |
Is there an example for hierarchicalFacetsRefinements? Categories.lvl0 is working but when I try it with categories.lvl1: "value1 > value2", I'm getting separator errors or forEach javascript errors. Both in the InstantSearch -> getRefinements.js file. |
If you are using Vue InstantSearch v2.7.0, you can use <ais-state-results>
<pre slot-scope="{state}">{{state}}</pre>
</ais-state-results> You can then see that the {
"hierarchicalFacetsRefinements": {
"hierarchicalCategories.lvl0": [
"Appliances > Fans"
]
},
} Thus, it's the value of the deepest refined level, but on the key of the first level. A sandbox showing this technique is here: https://codesandbox.io/s/vue-instantsearch-v2-starter-spi7n |
this is what you want: Just add a function in data wich prepopulates state searchFunction(helper) { helper.state.facetFilters = [["active:inaktiv"], ["storeFilter:Bad Reichenhall"], ["productTypes:Poker", "productTypes:Event"]];
|
there's |
No description provided.
The text was updated successfully, but these errors were encountered: