Enterprise Search Engineering

SkillSearch

Enterprise search: relevance tuning, query understanding, index management, search quality, ranking optimization, schema design.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Enterprise Search Engineering skill

What this skill tells your AI

The instructions your AI receives, as published by notque/vexjoy-agent in skills/engineering/enterprise-search/SKILL.md and read by ahel’s review.

Search infrastructure design, relevance tuning, query understanding, index management, quality measurement, and performance optimization. Each mode loads its own reference files on demand.


Mode Detection

Classify into one mode before proceeding.

ModeSignal PhrasesReference
RELEVANCEtune relevance, BM25, boost, function score, field weight, LTR, learned ranking, ranking modelreferences/relevance-tuning.md
QUERYquery understanding, intent classification, entity extraction, query expansion, synonyms, spell correction, query rewritingreferences/query-understanding.md
INDEXschema design, mapping, analyzer chain, reindex, alias, ILM, index template, field typereferences/index-management.md
QUALITYnDCG, MRR, precision, recall, search quality, judgment, A/B test, evaluation, search funnelreferences/search-quality.md
PERFORMANCEslow query, shard, cache, circuit breaker, scroll, search_after, query optimization, latencyreferences/performance-optimization.md
ARCHITECTUREsearch architecture, hybrid search, vector search, pipeline design, platform selection, migration(cross-reference: load relevant references based on sub-topic)

If the request spans modes, pick the primary and note the secondary. ARCHITECTURE mode loads references from whichever sub-topics apply.


Workflow by Mode

RELEVANCE Mode

Load: references/relevance-tuning.md, references/llm-search-failure-modes.md

  1. Diagnose — Identify the relevance problem before tuning.
Problem ClassSymptomsStarting Point
Poor precisionGood results buried under noiseField boosting, minimum_should_match
Poor recallKnown-good results missingAnalyzer tuning, query expansion, synonym filters
Wrong orderingRight results, wrong rankBM25 parameter tuning, function scoring
Domain mismatchGeneric scoring fails domainLearned ranking (LTR), custom similarity
FreshnessStale results ranked too highDecay functions, recency boosts
  1. Baseline — Capture current relevance metrics before making changes. Minimum: nDCG@10, P@5, MRR on a representative judgment set. No tuning without a baseline.

  2. Tune — Apply changes from the reference. One variable at a time. Measure after each change.

Tuning LayerToolsWhen to Use
Analyzer chainTokenizers, filters, char_filtersRecall problems, morphological mismatch
Field boostingMulti-match boosts, cross_fieldsSome fields matter more than others
BM25 parametersk1, b per fieldContent-type-specific term saturation
Function scoringDecay, field_value_factor, script_scoreNon-textual relevance signals (popularity, freshness, authority)
Rescoringrescore query with window_sizeExpensive scoring on top-N candidates
Learned ranking (LTR)Feature engineering, model training, SLTR pluginBM25 + hand-tuned boosts plateau
  1. Validate — Compare against baseline. Accept only statistically significant improvements. Check for regression on other query classes.

Gate: Baseline metrics captured. Each tuning change measured independently. No "tuned several things and it got better" — isolate the effect.

QUERY Mode

Load: references/query-understanding.md, references/llm-search-failure-modes.md

  1. Classify query intent — Determine what the user wants before constructing the query.
IntentExampleQuery Strategy
Navigational"OpenSearch documentation"Exact match, title boost, URL matching
Informational"how to configure sharding"Full-text across body fields, snippet extraction
Transactional"buy enterprise license"Product/SKU fields, availability filters
Faceted"red shoes size 10"Structured filters + text scoring
Exploratory"machine learning applications"Broad match, diversified results, related terms
  1. Extract entities — People, products, dates, categories, attributes from the query string.

  2. Transform — Apply query expansion, spelling correction, synonym injection, and relaxation strategies from the reference.

  3. Construct — Build the platform-specific query DSL. Include:

    • bool query structure (must/should/filter/must_not)
    • Field selection and boosting
    • Filters vs scoring clauses (filters for hard constraints, scoring for ranking signals)
    • Aggregations for facets
  4. Test — Validate against known queries. Check that transformations improve recall without destroying precision.

Gate: Query pipeline handles the 5 intent types. Entity extraction covers the domain vocabulary. Expansion and relaxation strategies are measurable.

INDEX Mode

Load: references/index-management.md, references/llm-search-failure-modes.md

  1. Requirements — Gather before designing.
QuestionWhy It Matters
Document count and growth rateShard count, ILM policy
Average document sizeShard sizing, bulk indexing batch size
Query patternsWhich fields need text analysis vs keyword vs numeric
Update frequencyNear-real-time vs batch, refresh interval
Retention policyILM phases, rollover triggers
Access patternsHot/warm/cold architecture, read vs write ratio
  1. Design schema — Map fields with appropriate types. Use the reference for type selection guidance.

  2. Configure analyzers — Build analyzer chains for each text field. Standard analyzer is a starting point, not a solution.

  3. Template and alias — Set up index templates for consistent creation. Use aliases for zero-downtime operations.

  4. Reindex strategy — Plan for schema evolution. Reindexing is inevitable; design for it.

Gate: Schema covers all query-time field requirements. Analyzer chains tested against representative content. Alias strategy supports zero-downtime reindexing.

QUALITY Mode

Load: references/search-quality.md, references/llm-search-failure-modes.md

  1. Define metrics — Select metrics appropriate to the use case.
MetricMeasuresBest For
nDCG@kGraded relevance at rank kRankings with multiple relevance levels
MRRPosition of first relevant resultNavigational queries, single-answer
P@kFraction relevant in top kPrecision-critical applications
Recall@kFraction of relevant docs found in top kRecall-critical applications (legal, compliance)
MAPAverage precision across recall levelsBalanced precision/recall
  1. Collect judgments — Build the ground truth dataset.
MethodScaleQualityCost
Expert annotationSmall (100s)HighestHigh
Click logsLarge (10K+)Moderate (position bias)Low
CrowdsourcingMedium (1K+)VariableMedium
LLM-assistedMedium-LargeGood for initial pass, needs validationLow
  1. Evaluate — Run offline evaluation. Compare configurations. Report metrics with confidence intervals.

  2. Online testing — A/B test or interleave changes against production. Measure engagement metrics alongside relevance metrics.

  3. Monitor — Continuous quality dashboards. Alerting on metric degradation. Search funnel analysis (query -> click -> conversion).

Gate: Judgment set exists with documented guidelines. Offline metrics computed with confidence intervals. Online test plan specifies primary metric, minimum detectable effect, and sample size.

PERFORMANCE Mode

Load: references/performance-optimization.md, references/llm-search-failure-modes.md

  1. Profile — Identify the bottleneck before optimizing.
SymptomLikely CauseDiagnostic
High p99 latencySlow queries, GC pauses, shard imbalanceSlow query log, node stats, hot threads
Throughput ceilingUndersized thread pools, too many shardsThread pool stats, shard count per node
Memory pressureField data, too many aggregations, deep paginationNode stats, circuit breaker trips
Indexing lagMerge throttling, refresh overhead, slow pipelinesIndex stats, merge stats
Cluster instabilitySplit brain, disk watermarks, master stormsCluster health, allocation explain
  1. Diagnose — Use platform diagnostics to confirm the cause. Measure before changing.

  2. Optimize — Apply targeted fixes from the reference. One change at a time, measure the effect.

  3. Validate — Load test the change. Check that optimization does not degrade other metrics (latency vs throughput tradeoff, cache hit rate vs memory).

Gate: Bottleneck identified with evidence. Fix targeted at root cause. Load test confirms improvement without regression.

ARCHITECTURE Mode

Cross-cutting mode. Load references based on the specific question.

  1. Platform evaluation — When selecting or migrating between platforms.
PlatformStrengthsConsider When
Elasticsearch/OpenSearchMature ecosystem, Lucene-based, strong text searchGeneral-purpose search, log analytics
VespaBuilt-in ML serving, tensor computation, real-time updatesML-heavy ranking, large-scale recommendations
TypesenseSimple API, typo tolerance, easy setupDeveloper-facing search, smaller datasets
SolrConfigurable, NRT, strong facetingLegacy integration, specific Solr features
MeilisearchInstant search, typo-tolerant, developer-friendlyFrontend search, prototyping
Custom (Lucene/Tantivy)Full control, embeddedSpecialized needs, tight integration
  1. Hybrid search design — When combining keyword and vector retrieval.
StrategyHowTradeoff
Score fusion (RRF)Reciprocal rank fusion of BM25 + vector resultsSimple, no training needed. Weights are heuristic.
Linear combinationWeighted sum of normalized BM25 + vector scoresTunable. Requires score normalization.
Re-rankingBM25 retrieval -> vector re-rank top NEfficient. Vector search only on candidates.
Two-stageCoarse retrieval (either) -> fine-grained re-rank (LTR)Best quality. Most complex.
  1. Pipeline design — Ingestion, enrichment, indexing, query, ranking pipelines.

  2. Migration planning — Version upgrades, platform changes, zero-downtime strategies.


LLM Failure Modes in Search Engineering

Load references/llm-search-failure-modes.md for all modes. These are the specific ways LLMs fail at search tasks:

Failure ModeWhat HappensDefense
Hallucinated query DSLLLM invents plausible-looking query syntax that does not existValidate every query against the specific platform version's API docs
Version confusionMixing Elasticsearch 7.x and 8.x APIs, or ES and OpenSearch syntaxState the exact platform and version upfront. Reference version-specific docs.
Generic relevance advice"Improve your relevance by boosting important fields" without specificsRequire concrete field names, boost values, and expected metric impact
Vector search as defaultRecommending embeddings when BM25 with good analyzers solves the problemStart with BM25 tuning. Vector search adds complexity; justify the added value.
Ignoring measurementSuggesting changes without a quality measurement frameworkRequire baseline metrics before any tuning recommendation
Deprecated feature suggestionsRecommending removed or deprecated APIs (type mappings, indices.optimize)Check the deprecation/migration guide for the target version
Over-engineered schemasAdding 50 fields with sub-fields when 10 fields cover the queriesSchema complexity should match query requirements, not data model completeness
Cargo-cult configurationCopying cluster settings from blog posts without understanding the workloadEvery configuration value should have a justification tied to the specific workload

Platform-Specific Conventions

When generating configuration or queries, always specify the target platform and version.

PlatformQuery LanguageConfig FormatKey Differences
Elasticsearch 8.xQuery DSL (JSON)elasticsearch.ymlSecurity on by default, no type mappings
OpenSearch 2.xQuery DSL (JSON)opensearch.ymlFork divergence from ES 7.10, alerting built-in
Solr 9.xSolrQL / JSON Request APIsolrconfig.xml + schema.xmlConfig-driven, ZooKeeper coordination
VespaYQLservices.xml + schemasCustom ranking expressions, tensors native
TypesenseREST paramsCommand-line / JSONSimpler model, automatic typo tolerance

Cross-platform traps:

  • OpenSearch _search API is largely ES 7.10-compatible, but diverges on security, ML, and alerting APIs
  • Elasticsearch _field_caps behavior changed between 7.x and 8.x
  • Solr edismax and ES multi_match are similar in concept but differ in syntax, defaults, and tie-breaking
  • Vespa ranking expressions are not Lucene scoring — different mental model entirely

Output Conventions

  • Markdown with clear headers. Scannable by engineers.
  • All query DSL in fenced code blocks with platform and version annotation: ````json // OpenSearch 2.x```
  • Tables for parameter comparisons, metric results, configuration options.
  • Every recommendation includes: what to change, why, expected effect, how to measure.
  • Configuration snippets are copy-pasteable with comments explaining each value.

Reference Loading Table

ReferenceContentsLoad When
references/relevance-tuning.mdBM25 parameters, LTR features, boost strategies, function scoring, field weightingRELEVANCE mode, or relevance sub-questions in other modes
references/query-understanding.mdIntent classification, entity extraction, query expansion, spell correction, query relaxationQUERY mode, or query pipeline questions
references/index-management.mdSchema design, analyzer chains, mapping optimization, reindex strategies, ILMINDEX mode, or schema/mapping questions
references/search-quality.mdnDCG, MRR, P@k, judgment collection, A/B testing, evaluation methodologyQUALITY mode, or measurement questions
references/performance-optimization.mdQuery optimization, caching, sharding, pagination, circuit breakers, slow query diagnosisAll modes — always load as guardrail
references/llm-search-failure-modes.mdHow LLMs fail at search tasks: hallucinated DSL, version confusion, generic advice, measurement avoidanceAll modes — always load as guardrail

Signals

GitHub stars
419
Forks
44
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
enterprise-search
Source
github.com/notque/vexjoy-agent