When to Use Virtual Fields
You can use virtual fields for multiple areas within your search application. For example, for a given hit, virtual fields can calculate:
-
A meta to display in the search client.
-
The value for the hit in a dynamic numerical facet (see below).
-
The value for the hit in a facet aggregation (see below).
-
Ranking elements (see below).
-
A value to use for filtering queries.
For example, you can define a numerical prefix handler, total_price, allowing a user to queries directly on the total price, such as.
total_price: > 500
.