You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Session: Querying: How to perform a multifaceted search?

Multiple Facet queries can be executed at once using MultiFacetedSearch method from Advanced session operations.

Syntax

FacetResults[] MultiFacetedSearch(params FacetQuery[] queries);

Parameters
queries params FacetQuery Array of FacetQueries that will be executed on server.
Return Value
FacetResult[] Array of FacetResults. Each matching its FacetQuery position from queries parameter.

Example

FacetQuery facetQuery1 = session.Query<Camera>()
	.ToFacetQuery("facets/CameraFacets1");

FacetQuery facetQuery2 = session.Query<Camera>()
	.ToFacetQuery("facets/CameraFacets2");

FacetResults[] results = session
	.Advanced
	.MultiFacetedSearch(facetQuery1, facetQuery2);

FacetResults facetResults1 = results[0];
FacetResults facetResults2 = results[1];