Skip to content

bug with selected value for boolean facet #119

@SergeyRe

Description

@SergeyRe

to reproduce:

const data = [{ "boolean": true, "string": "true" }]
const itemsjs = require('itemsjs')(data, {
    aggregations: {
        boolean: {},
        string: {}
    }
});

const aggs = itemsjs.search({
    filters: {
        boolean: [true],
        string: ["true"]
    }
}).data.aggregations

console.log(aggs.boolean.buckets, aggs.string.buckets)

//[{ key: 'true', doc_count: 1, selected: false }][{ key: 'true', doc_count: 1, selected: true }]`

for comparison there 2 fields : boolean and string . Both are aggregations and search made under both of them
in first case we have "selected:false" for boolean ( looks like a bug) and "selected:true" for string ( its OK)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions