Skip to content

filter on boolean value not working #282

Closed
@Nesse

Description

@Nesse

Hi,

I'm trying to filter on a boolean fieldtype, but it doesn't seem to work. I also get the results that are false.

        // all specification items
        var queryResultsAllSpecificationItems = ElasticClient.Search<ProductSpecificationAttribute>(s => s
          .Query(q => q
              .Bool(bq => bq
                  .Must(
                        mq => mq.ConstantScore(cs => cs
                            .Filter(f => f.Terms("productId", allFilteredProductIds))
                        ),
                        mq => mq.ConstantScore(cs => cs
                            .Filter(f => f.Term(t => t.AllowFiltering, "true"))
                        )
                  )
              )
          )
          .FacetTerm(t => t
              .OnField(f => f.SpecificationAttributeOptionId)
              .Size(maxSize)
          )
          .Fields(f => f.SpecificationAttributeOptionId)
       );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions