DSL usage
Compiler mapping
ranking(num_typos:)→num_typos(0/1/2)ranking(drop_tokens_threshold:)→drop_tokens_threshold(0.0..1.0)ranking(prioritize_exact_match:)→prioritize_exact_match(Boolean)ranking(query_by_weights:)→query_by_weightsas a comma list aligned to the effectivequery_byfields; fields without explicit weight default to 1prefix(mode)→infixwhere::disabled→"off":fallback→"fallback":always→"always"
Explain & DX
rel.dry_run!includes the compiled params in{ url:, body:, url_opts: }rel.explainshows:- effective
query_byfields - weight vector (defaults filled with 1)
num_typos,drop_tokens_threshold,prioritize_exact_match,prefix(viainfixtoken)
- effective
Guidance
- Start with:
num_typos=1,drop_tokens_threshold≈0.2,prefix=:fallback - Increase weights gradually; avoid setting all weights to
0 - Prefer explicit
query_byper search or configureSearchEngine.config.default_query_by
Troubleshooting
- Weight for unknown field:
- Ensure the key exists in the effective
query_bylist; see Relation Guide → selection
- Ensure the key exists in the effective
- Threshold out of range:
- Use
0.0..1.0
- Use
- All weights zero:
- At least one field must have weight
> 0
- At least one field must have weight
- Unknown prefix mode:
- Valid:
:disabled,:fallback,:always
- Valid: