Giter VIP home page Giter VIP logo

Comments (5)

cigolpl avatar cigolpl commented on September 14, 2024

@tfrancart thanks for a feedback!

Returning the complete list of values even if the doc_count is 0 might be a good feature as a new configuration option. Feel free to make a PR.

Right now workaround like triggering an empty search to get all filters seems best

from itemsjs.

tfrancart avatar tfrancart commented on September 14, 2024

Hi, thanks for the answer. Unfortunately I don't have the Javascript skills nor the bandwith to contribute directly to the code.
Maybe you could point to the exact place in lib.js where the modification should take place ?
I'd be also happy to test any improvement, and contribute to documentation on that new parameter.

from itemsjs.

cigolpl avatar cigolpl commented on September 14, 2024

This .buckets function is responsible for returning values in filters behavior:

module.exports.buckets = function(items, field, agg, aggregations) {

Please let's try conjunction: false in filters as in example (https://github.com/itemsapi/itemsjs/blob/master/docs/configuration.md). Probably that is what you are looking for.

from itemsjs.

tfrancart avatar tfrancart commented on September 14, 2024

Thanks for coming back to me on this

Please let's try conjunction: false in filters as in example (https://github.com/itemsapi/itemsjs/blob/master/docs/configuration.md). Probably that is what you are looking for.

This is not quite what I am looking for. With conjunction: false, I always get the same values in the aggregation, with the same doc_count, independantly of the current result set. I think this really means : "this facet should be interpreted as an OR, so the user should be able to select multiple values from it, including values that are outside of the current result set, so let's always return the complete list of values, with total doc_count".
I need the same thing, but with the doc_count updated with respect to the current result set. I don't know if this could be an update of the existing conjunction: false flag, or if this requires a separate option.

from itemsjs.

cigolpl avatar cigolpl commented on September 14, 2024

Hey @tfrancart, this issue has been resolved in the new version 2.0.0. All filters are listed now even if positive number or 0. You can test it out here https://jsfiddle.net/cigol/0ef9qeos/181.

If that's still not working properly please reopen

from itemsjs.

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.