Code Monkey home page Code Monkey logo

Comments (8)

aallam avatar aallam commented on May 29, 2024 1

Hi @mario202k, SearchResponse.facets will only have values if SearchState.facets was not empty. Could you please share how do you create your SearchState? (it's toSearchState I guess)!
You can also enable logging to see exactly what query is being built and sent under the hood.
Edit: since what you need is to get and display facets, maybe you want to take a look at FacetList, here is an example of it usage :)

from algoliasearch-helper-flutter.

mario202k avatar mario202k commented on May 29, 2024 1

Hi @mario202k, SearchResponse.facets will only have values if SearchState.facets was not empty. Could you please share how do you create your SearchState? (it's toSearchState I guess)! You can also enable logging to see exactly what query is being built and sent under the hood. Edit: since what you need is to get and display facets, maybe you want to take a look at FacetList, here is an example of it usage :)

Thank you. I have forgotten to add facets in SearchState. :-)

from algoliasearch-helper-flutter.

mario202k avatar mario202k commented on May 29, 2024

Hi @aallam. Why when I set my facets like this : facets: ["availableSizes","availableColors"], it always display the last facets? if I remove "availableColors" it will display "availableSizes" not both?

from algoliasearch-helper-flutter.

aallam avatar aallam commented on May 29, 2024

Hey @mario202k, how are you displaying your facets lists? are you using FacetList or doing it manually ?

from algoliasearch-helper-flutter.

mario202k avatar mario202k commented on May 29, 2024

I don't know what is facets lists. For me it's "Attributes for faceting" in the console. I found a way: facets: ["*"] Like this I have all the facets that I've configured in the Algolia console. Am I right?

from algoliasearch-helper-flutter.

VladislavFitz avatar VladislavFitz commented on May 29, 2024

Hi @mario202k,
The "Attributes for faceting" value is the persistent setting of your index. By setting this parameter, you specify the fields of your records you want to use for faceting. It's enough to do it just once from the dashboard.
Then, you can specify the facets values you want to fetch with each search request using the facets parameter. By default its value is ["*"] which means getting all the facets, so

I found a way: facets: ["*"] Like this I have all the facets that I've configured in the Algolia console. Am I right?

Yes, you are right.

Why when I set my facets like this : facets: ["availableSizes","availableColors"], it always display the last facets?

What do you mean by "last facets" here?

If you want to build the UI presenting the list of selectable facets, we recommend to use the FacetList component.
You can find it here with its documentation. It automatically sets the proper facets value being connected to your HitsSearcher, so you don't need to configure it manually.

from algoliasearch-helper-flutter.

gbolahan507 avatar gbolahan507 commented on May 29, 2024

@aallam pls i only need to display two facet from my atribute and have added it using filterstate but am getting empty screen
Screenshot 2023-01-27 at 10 37 50

from algoliasearch-helper-flutter.

aallam avatar aallam commented on May 29, 2024

Hi @gbolahan507, could you please share how do you display your facets ? also I would recommend enabling logging to see the actual http calls and responses for better debugging.

from algoliasearch-helper-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.