Queries

Queries

Feature

Create a query to filter or to use in filter query

How to

  1. Use some feature that allow use SearchQuery<> (i.e. Filter or FacetQuery)

  2. Configure query

    DocumentCollection<TechProductDocument> documentCollection; // from DI

    var rersult = documentCollection
        .Select()
         // cat:"some category"
        .Filter(q => q.Categories, query => query.EqualsTo("some category"))
        .Execute();
  1. Optionally use a chain of methods

    DocumentCollection<TechProductDocument> documentCollection; // from DI

    var rersult = documentCollection
        .Select()
         // cat:"some category" OR features:("feature1" OR "feature2")
        .Filter(q => q.Categories, query => query
            .EqualsTo("some category")
            .Or(nested => nested
                .Field(f => f.Features)
                .Any("feature1", "feature2")))
        .Execute();

Simple cases

Complex queries

Last updated