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

Custom Facet #1650

Closed
RFSH opened this issue Sep 19, 2018 · 1 comment
Closed

Custom Facet #1650

RFSH opened this issue Sep 19, 2018 · 1 comment
Assignees

Comments

@RFSH
Copy link
Member

RFSH commented Sep 19, 2018

In some deployments we want to have more complicated facet filters that are not understandable by simple custom filters, and also the UI doesn't know how to handle.

For this use-case, we decided to introduce a new custom-facet blob which will have the same syntax as facet but won't be merged with facet in the client. Then recordset still can function. The same way that we are showing the whole custom-filter in a chicklet, we're going to show this custom-facet in a separate chicklet. We should also be able to change the value that is displayed to the user in the chicklet.

more information about the minimum combination of and/or that should be supported is missing

@hongsudt can you please update the description with more information about what type of filters we want to support?

@RFSH RFSH self-assigned this Sep 19, 2018
@RFSH
Copy link
Member Author

RFSH commented Oct 4, 2018

It seems like for now we just want "and" of "and"s which can be supported with the current syntax of facet. So all we should do is adding the support for *::cfacets::blob to ermrestjs. The blob will be encoded the same way as facet and the object will have the following format:

{
  "displayname": "a markdown displayname",
  "ermrest_path": "ermrest path",
  "facets": {
    "and": [
      {"source": "F1", "choices": ["1"]},
      {"source": "F1", "choices": ["2"]}, ...
    ]
  }
}

Other improvements that can be done later:

  • One problem that using the current syntax has is performance. For each of the source facets we are going to traverse the path and then do the filter. Now in this case, these sources will be identical. We could instead traverse the path once and then "and" the filters. This could be added as a different mode in the current syntax, to treat the values in the choices array as conjunction instead of disjunction.
  • Investigate how we can do "or" of "and"s. I'm not sure how this can be achieved in ermrest.

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

1 participant