Within Searchkit configuration, you can specify how you want to transform the query string into an elasticsearch query. Out of the box there are two options:
Allows you to query multiple fields + adjustments on how important each field is.
The above example will use the incoming query value and return documents which the query value match in either title or description. Title is boosted to 2x, making documents with a match in the title appear first on the result set.
Allows you to have full control over the what the elasticsearch query should be, using the elasticsearch Query DSL.
When you need to be able to provide some sort of options at query time. Examples include:
- Advanced Search UI where customer can specify what fields to search by
- Customer wants to adjust which fields are the most relevant for their search
You can do this by using QueryOptions and CustomQuery. Within the graphQL query, you can specify fields at query time
and adjust the customQuery function to change the DSL based on the options
If you want to see the query thats being requested to Elasticsearch, use the
DEBUG_MODE=true environment variable to log the query at every request. see Debug Logging