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

Define and implement final shape of the state #1581

Closed
4 tasks done
vvo opened this issue Nov 18, 2016 · 5 comments
Closed
4 tasks done

Define and implement final shape of the state #1581

vvo opened this issue Nov 18, 2016 · 5 comments

Comments

@vvo
Copy link
Contributor

vvo commented Nov 18, 2016

  • separate facet names from the root of instantsearch state to avoid ID collisions
  • document instantsearch state in a GUIDE
  • explain where to find state of a widget in instantsearch state in every widget doc
  • stop using minified tokens (p, q), this is the responsibility of state synchronisation
{
  page: 0, // any widget handling a single parameter that is a direct mapping to an Algolia REST parameter should put the parameter at root level
  hitsPerPage: 10, // same here
  query: 'a', // same here, we use `q` I believe today, this needs to be changed, there's no reason to use minified parameters in the full state shape
  menu: {
    attributeName: 'refinement'
  },
  hierarchicalMenu: {
    attributeName: 'refinement'
  },
}
@vvo vvo changed the title Namespace search concepts in instantsearch state Define and implement final shape of the state Nov 24, 2016
@mthuret mthuret self-assigned this Nov 29, 2016
@mthuret
Copy link
Contributor

mthuret commented Nov 30, 2016

@vvo, @bobylito: Here is an example of state with all of our connectors used. Is everything ok for you?

{
  "range": {
    "price": {
      "min": "200",
      "max": "500"
    }
  },
  "refinementList": {
    "colors": [
      "White",
      "High gloss gray",
      "Black-brown",
      "High gloss white",
      "Walnut effect"
    ]
  },
  "hierarchicalMenu": {
    "category": "Bathroom"
  },
  "hitsPerPage": "2",
  "menu": {
    "type": "High cabinet with mirror door, black-brown"
  },
  "multiRange": {
    "price": "100:500"
  },
  "toggle": {
    "materials": "on"
  },
  "sortBy": "index_name",
  "query": "chair",
  "page": 2
}

@vvo
Copy link
Contributor Author

vvo commented Nov 30, 2016

For a first iteration, this looks good. We will iterate if needed on it. go!

@mthuret
Copy link
Contributor

mthuret commented Nov 30, 2016

It seems that only toggle as a state that differs from the format asked for defaultRefinement.
state is on or off and defaultRefinement is a simple boolean.
Do we want to change that?

@vvo
Copy link
Contributor Author

vvo commented Nov 30, 2016

It seems that only toggle as a state that differs from the format asked for defaultRefinement.
state is on or off and defaultRefinement is a simple boolean.
Do we want to change that?

Yes this is not consistent right?

@vvo
Copy link
Contributor Author

vvo commented Nov 30, 2016

State for toggle should be 1 or 0 too, not "on" "off", "on" and "off" could be non relevant token givent the attribute name manipulated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants