First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Search and AI (vector, hybrid search, reranking, RAG)
In Elasticsearch dense_vector fields, which similarity metric should you choose when vectors are normalized to unit length and you want to rank by cosine similarity?
- l2_norm
- dot_product Correct answer.
- hamming
- cosine only available via script_score
Explanation
For unit-length vectors, dot_product yields the same ranking as cosine similarity while being cheaper to compute, and Elasticsearch allows dot_product on dense_vector fields. Cosine similarity is available directly as a similarity value too, but the script_score-only claim is false. Hamming is not a supported dense_vector similarity.
Question 2Search and AI (vector, hybrid search, reranking, RAG)
Which Elasticsearch query type performs k-nearest-neighbor search over a dense_vector field in current versions?
- knn search via the knn top-level option or a knn query Correct answer.
- more_like_this
- rank_feature
- script_score only
Explanation
Elasticsearch exposes kNN through the top-level knn search option and the knn query, both of which operate on dense_vector fields. more_like_this works on terms, not vector similarity. rank_feature scores numeric features, not nearest neighbors.
Question 3Search and AI (vector, hybrid search, reranking, RAG)
You want the hybrid query to combine BM25 lexical scores with kNN vector scores. Which approach does Elasticsearch support natively?
- Use a terms aggregation to merge results
- Convert BM25 scores to vectors and run kNN
- Average the _score of two separate searches in the client
- Submit a knn clause with a query and use a rank combiner such as RRF Correct answer.
Explanation
A knn search accepts a query clause and a rank parameter, and Elasticsearch provides reciprocal rank fusion (RRF) to combine the lexical and vector rankings in one request. Client-side averaging is not a native hybrid mechanism and is score-scale sensitive. Aggregations cannot merge hit lists into a single ranking.
Question 4Search and AI (vector, hybrid search, reranking, RAG)
What does reciprocal rank fusion (RRF) use to compute a document's combined score?
- The average of the raw scores after min-max normalization
- The product of raw BM25 and vector similarity scores
- The highest rank the document achieved in any list
- The sum over result lists of 1 divided by a constant plus the document's rank Correct answer.
Explanation
RRF sums, across result lists, one divided by a rank constant plus the document's position in each list. This makes it robust to differences in score scales between lexical and vector retrievers. It deliberately ignores raw score magnitudes, so multiplying or normalizing raw scores is not RRF.
Question 5Search and AI (vector, hybrid search, reranking, RAG)
Which component in a retrieval-augmented generation pipeline is responsible for turning retrieved passages into grounded answer text?
- The BM25 inverted index
- The kNN vector index
- The large language model prompted with the retrieved context Correct answer.
- The ingest pipeline
Explanation
In RAG the retriever supplies passages and the language model, conditioned on those passages, generates the answer. The vector index and inverted index only retrieve candidates. Ingest pipelines transform documents at index time and do not generate answers.
Question 6Search and AI (vector, hybrid search, reranking, RAG)
A dense_vector field is declared with dims set to 768, but you index a document whose embedding has 1024 dimensions. What happens?
- Elasticsearch truncates the vector to 768 dimensions
- Elasticsearch pads the vector with zeros to 1024
- The field is silently remapped to 1024 dimensions
- The indexing request is rejected because the vector length does not match dims Correct answer.
Explanation
The dims parameter fixes the vector length for the field, and documents with a different number of dimensions fail indexing. Elasticsearch does not pad, truncate, or remap automatically. The mapping must match the embedding model output exactly.
Question 7Search and AI (vector, hybrid search, reranking, RAG)
Which technique reduces the memory footprint of a dense_vector field while keeping approximate nearest-neighbor search viable at scale?
- Storing vectors as text
- Increasing the number of shards
- Disabling _source
- Quantization such as int8_hnsw Correct answer.
Explanation
Quantization, for example int8_hnsw, stores compressed vectors so the HNSW graph uses far less memory while still supporting approximate kNN. Storing vectors as text loses vector search capability. More shards spread data but do not shrink per-vector memory, and disabling _source does not compress the vector index.
Question 8Search and AI (vector, hybrid search, reranking, RAG)
When chunking documents for a RAG index, which practice generally improves retrieval quality?
- Remove all metadata from chunks
- Split on semantic boundaries and keep modest overlap between chunks Correct answer.
- Index each document as one very large chunk
- Use fixed 5000-token chunks with no overlap
Explanation
Chunks aligned to semantic boundaries retrieve more coherent context, and modest overlap preserves information that straddles a boundary. Very large chunks dilute the embedding and waste context window. Stripping metadata removes useful filtering signals.
Question 9Search and AI (vector, hybrid search, reranking, RAG)
What is the purpose of a reranking stage after initial retrieval in a search pipeline?
- To replace the inverted index with vectors
- To reduce the number of shards
- To expand the index with new documents
- To reorder a small candidate set with a more expensive, higher-precision model Correct answer.
Explanation
Reranking takes a limited candidate list from fast retrieval and applies a costlier model, such as a cross-encoder, to improve ordering precision. It does not index documents, replace the inverted index, or alter shard layout. The two-stage design balances latency against quality.
Question 10Search and AI (vector, hybrid search, reranking, RAG)
In a search pipeline, which processor is designed to apply a reranking model to the top hits returned by the query?
- text_similarity_reranker Correct answer.
- rename
- gsub
- set
Explanation
The text_similarity_reranker search pipeline processor reorders the top hits using a learned or inference-based similarity model. set, rename, and gsub are ingest processors for modifying documents at index time, not search-time reranking.
Question 11Search and AI (vector, hybrid search, reranking, RAG)
Which Elasticsearch feature lets you store and run a trained machine learning model, such as a text embedding model, inside the cluster?
- Watcher
- Snapshot lifecycle management
- Inference API with trained models Correct answer.
- Cross-cluster search
Explanation
The Inference API and trained model management allow models such as embedding or reranking models to be deployed and used inside Elasticsearch. Watcher handles alerting, cross-cluster search federates queries, and snapshot lifecycle management handles backups.
Question 12Search and AI (vector, hybrid search, reranking, RAG)
You build a semantic search index using ELSER. Which statement describes how ELSER represents text?
- It replaces BM25 with exact term matching
- It produces dense 768-dimension float vectors
- It requires storing embeddings in a keyword field
- It produces sparse token-weight vectors stored in a sparse_vector field Correct answer.
Explanation
ELSER is a learned sparse retrieval model that expands text into weighted tokens stored in a sparse_vector field. It does not emit fixed-length dense vectors, and it does not reduce search to exact term matching. Keyword fields cannot hold expansion weights for scoring.
Question 13Search and AI (vector, hybrid search, reranking, RAG)
A user reports that semantic results miss exact product codes. Which hybrid adjustment best addresses this?
- Lower the index refresh interval
- Increase the vector dimensions
- Disable the _source field
- Keep the lexical query clause in the knn request so exact terms still match Correct answer.
Explanation
Combining the lexical query with kNN in a hybrid request preserves exact-match recall for identifiers like product codes while retaining semantic matching. Vector dimensions are fixed by the model and cannot be tuned per query. Refresh interval and _source settings do not affect matching of exact terms.
Question 14Search and AI (vector, hybrid search, reranking, RAG)
What does the num_candidates parameter control in a kNN search?
- The number of shards the query targets
- The maximum document size accepted by the index
- The number of replicas used for the search
- How many nearest-neighbor candidates each shard considers before selecting the final top k Correct answer.
Explanation
num_candidates sets how many approximate candidates each shard gathers before the final top k are chosen, trading recall against latency. It does not set shard count, replica count, or document size limits. Higher values typically improve recall at added cost.
Question 15Search and AI (vector, hybrid search, reranking, RAG)
Which statement correctly contrasts dense and sparse retrieval in Elasticsearch?
- Dense vectors capture semantic similarity, while sparse vectors such as ELSER weights emphasize learned term importance Correct answer.
- Sparse vectors cannot be stored in Elasticsearch
- Dense vectors require keyword fields
- Dense vectors only work with BM25 scoring
Explanation
Dense embeddings encode semantic meaning in fixed-length vectors, while sparse representations like ELSER assign learned weights to vocabulary tokens. Dense vectors are independent of BM25, and sparse vectors are supported through sparse_vector fields. Dense vectors are stored in dense_vector fields, not keyword fields.
Question 16Search and AI (vector, hybrid search, reranking, RAG)
In a RAG system, what is the main risk of returning too many retrieved chunks to the language model?
- The kNN graph is deleted
- The vector index is automatically rebuilt
- The context window fills with less relevant text, raising cost and diluting grounding Correct answer.
- BM25 scoring is disabled
Explanation
Stuffing many chunks consumes context tokens, increases cost, and can bury the most relevant evidence, reducing answer quality. Retrieval volume does not trigger index rebuilds, delete graphs, or disable lexical scoring. Selecting fewer, better-ranked chunks usually improves grounding.
Question 17Search and AI (vector, hybrid search, reranking, RAG)
Which similarity is computed when a dense_vector field uses the cosine similarity setting?
- The dot product without normalization
- The cosine of the angle between query and document vectors Correct answer.
- The number of shared tokens
- The Euclidean distance between vectors
Explanation
The cosine setting scores by the cosine of the angle between vectors, which is magnitude-insensitive. Euclidean distance corresponds to l2_norm, and shared-token counts describe lexical matching. Plain dot product without normalization is the dot_product setting.
Question 18Search and AI (vector, hybrid search, reranking, RAG)
You need to filter kNN results by a tenant_id keyword field for security. Where should the filter be applied?
- After retrieval in the client application
- By boosting tenant_id in the query
- By creating a separate cluster per tenant only
- Inside the knn clause as a filter so candidates respect it during search Correct answer.
Explanation
Applying the filter within the knn clause restricts candidate selection to matching documents, which is both correct and efficient for tenant isolation. Client-side filtering after retrieval can leak data and wastes work. Boosting does not enforce isolation.
Question 19Search and AI (vector, hybrid search, reranking, RAG)
Which statement about approximate kNN with HNSW in Elasticsearch is accurate?
- It cannot be combined with filters
- It requires disabling replicas
- It trades a small amount of recall for large gains in speed compared with exact search Correct answer.
- It always returns the exact nearest neighbors
Explanation
HNSW is an approximate graph algorithm that sacrifices some recall for substantial speed and scalability benefits. It does not guarantee exact results, and it supports filtering within kNN queries. Replica settings are unrelated to the algorithm choice.
Question 20Search and AI (vector, hybrid search, reranking, RAG)
What is the role of a cross-encoder in a retrieval pipeline?
- It scores query-passage pairs jointly to produce a precise relevance score for reranking Correct answer.
- It compresses vectors for storage
- It builds the inverted index
- It generates embeddings for the whole corpus at query time
Explanation
A cross-encoder processes the query and each candidate passage together, capturing interactions that bi-encoders miss, which makes it well suited to reranking a small set. It does not build indexes, compress vectors, or embed the corpus during the query. Its cost is why it runs only on top candidates.
Question 21Search and AI (vector, hybrid search, reranking, RAG)
Which query construct lets you combine a semantic sparse_vector query with a traditional BM25 match in a single relevance score?
- A terms aggregation
- A snapshot restore
- A cat indices call
- A bool query with should clauses combining sparse_vector and match Correct answer.
Explanation
A bool query with should clauses sums the scores of a sparse_vector query and a match query, blending semantic and lexical relevance. Aggregations, snapshot restores, and cat APIs do not compute combined relevance scores.
Question 22Search and AI (vector, hybrid search, reranking, RAG)
Why is it important that the embedding model used at index time matches the model used at query time?
- Vectors from different models occupy incompatible spaces, so similarity scores become meaningless Correct answer.
- It disables BM25 automatically
- It reduces the number of shards required
- It avoids the need for a mapping
Explanation
Each embedding model defines its own vector space and dimensions, so mixing models produces incomparable vectors and poor similarity. Model consistency does not affect shard counts or remove mapping requirements, and it has no effect on BM25 behavior.
Question 23Search and AI (vector, hybrid search, reranking, RAG)
A team wants to measure retrieval quality of a RAG pipeline before tuning generation. Which metric set is most appropriate?
- Number of ingest pipelines
- Recall at k and mean reciprocal rank of the retrieved chunks Correct answer.
- Indexing throughput and shard count
- Cluster CPU and heap usage
Explanation
Retrieval quality is measured with ranking metrics such as recall at k and mean reciprocal rank against labeled relevant chunks. Throughput, resource usage, and pipeline counts describe operational health rather than retrieval accuracy. Evaluating retrieval separately isolates errors before generation tuning.
Question 24Search and AI (vector, hybrid search, reranking, RAG)
What does the knn search option's k parameter specify?
- The number of top nearest neighbors to return per shard before merging Correct answer.
- The number of candidate vectors to examine
- The number of shards to query
- The vector dimensionality
Explanation
The k parameter sets how many nearest neighbors are returned as top hits, while num_candidates controls how many candidates are examined. Shard selection and dimensionality are set elsewhere. Confusing k with num_candidates is a common error.
Question 25Search and AI (vector, hybrid search, reranking, RAG)
Which approach best improves grounding and reduces hallucination in a RAG answer?
- Increase the model temperature
- Instruct the model to answer only from the provided passages and to state when evidence is insufficient Correct answer.
- Retrieve only the single highest-scoring chunk
- Remove citations from the prompt
Explanation
Constraining the model to the supplied context and allowing an insufficient-evidence response reduces unsupported claims. Higher temperature increases variability and hallucination risk. Removing citations weakens verifiability, and a single chunk may omit needed evidence.
Question 26Search and AI (vector, hybrid search, reranking, RAG)
In a sparse_vector field indexed with ELSER, what do the stored token weights primarily represent?
- The cosine distance between the document and the query
- The term frequency of each token in the source document
- The byte length of each token after tokenization
- The learned importance of each expanded term for the passage Correct answer.
Explanation
ELSER is a learned sparse model: it expands text into weighted terms where the weight reflects the model's learned notion of that term's importance for the passage. It is not raw term frequency and not a distance metric.
Question 27Search and AI (vector, hybrid search, reranking, RAG)
Which field type must be used to store embeddings for approximate kNN search in Elasticsearch?
- float with a doc_values mapping
- sparse_vector with a trained model
- dense_vector with an index type of hnsw or int8_hnsw Correct answer.
- rank_features with positive weights
Explanation
Approximate kNN requires a dense_vector field configured with an index type (for example hnsw or int8_hnsw) and an appropriate similarity. Other field types either serve sparse retrieval or do not support vector indexing.
Question 28Search and AI (vector, hybrid search, reranking, RAG)
A hybrid query combines a BM25 match clause and a kNN clause. Which construct computes a single combined score across both clauses?
- A knn search with a filter clause on the text field
- A bool query with both clauses in a should array and minimum_should_match set to 1 Correct answer.
- A script_score query that multiplies the two scores
- A rank feature query over the text field
Explanation
Placing both clauses in a bool should array lets Elasticsearch score each clause and sum the contributions into one relevance score. minimum_should_match just guarantees at least one clause matches.
Question 29Search and AI (vector, hybrid search, reranking, RAG)
What does the k parameter in a top-level knn search section specify?
- The number of candidate vectors examined per shard
- The number of final nearest-neighbor documents returned as hits Correct answer.
- The number of nearest neighbors returned per shard before merging
- The number of shards the query is broadcast to
Explanation
In the top-level knn section, k is the final number of nearest neighbors returned in the response after the coordinating node merges per-shard results. num_candidates controls how many candidates each shard explores.
Question 30Search and AI (vector, hybrid search, reranking, RAG)
Which pipeline processor invokes a deployed reranking model over the hits produced by a query?
- text_embedding processor
- rerank processor Correct answer.
- set processor
- inference processor
Explanation
The rerank processor in a search pipeline takes the top hits from the first phase and scores them with a deployed reranking model. The inference processor is used for ingest-time enrichment such as generating embeddings.
Question 31Search and AI (vector, hybrid search, reranking, RAG)
Why must the embedding model used to index documents match the one used to embed queries?
- Because Elasticsearch caches query embeddings per model name
- Because vector dimensions must be identical and the semantic spaces must be aligned Correct answer.
- Because cosine similarity only works with symmetric models
- Because the query model must be smaller than the index model
Explanation
Vectors from different models live in different semantic spaces, so distances between a query vector and document vectors become meaningless even if dimensions happen to match. Consistency of model and version is required for valid similarity.
Question 32Search and AI (vector, hybrid search, reranking, RAG)
Which metric set best evaluates the retrieval stage of a RAG pipeline independently of the language model?
- Perplexity of the generator model
- Token count of the retrieved chunks
- Recall@k, precision@k, and mean reciprocal rank Correct answer.
- BLEU and ROUGE on generated answers
Explanation
Retrieval quality is measured with ranking metrics such as recall@k, precision@k, and MRR, which compare retrieved documents against known relevant ones. Generation metrics evaluate the answer text, not retrieval.
Question 33Search and AI (vector, hybrid search, reranking, RAG)
In Elasticsearch, what does a cross-encoder reranker do differently from the initial bi-encoder retrieval?
- It recomputes document embeddings and stores them in the index
- It expands the query with synonyms before retrieval
- It clusters candidate documents before scoring
- It scores each query-document pair jointly with full attention across both texts Correct answer.
Explanation
A cross-encoder feeds the query and candidate document together through the model, allowing token-level interaction between them, which usually yields more accurate relevance than independently computed embeddings. The cost is that it must run per candidate.
Question 34Search and AI (vector, hybrid search, reranking, RAG)
A team indexes 2 million chunks with a 768-dimension dense_vector field and wants to cut memory while keeping approximate kNN. Which change is most direct?
- Increase the number of shards
- Reduce num_candidates to 10
- Switch the field to int8_hnsw quantization Correct answer.
- Set the similarity to dot_product
Explanation
Quantized index types such as int8_hnsw store vectors in reduced precision, cutting memory substantially while preserving approximate kNN search. The other changes either affect candidate exploration or unrelated settings.
Question 35Search and AI (vector, hybrid search, reranking, RAG)
You must restrict kNN results to documents where tenant_id equals a given value. Which approach applies the filter correctly and efficiently?
- Use a post_filter on the knn query
- Retrieve the top 1000 neighbors and discard other tenants in the application
- Add tenant_id to the embedding vector
- Use the filter section inside the knn clause Correct answer.
Explanation
The filter inside the knn clause restricts the neighbor search itself, so only eligible documents are considered and results are not diluted by other tenants. Post-filtering after retrieval can return too few results and wastes work.
Question 36Search and AI (vector, hybrid search, reranking, RAG)
A RAG pipeline retrieves chunks but the answer omits a key fact that appears in a lower-ranked chunk. Which retrieval change most directly increases the chance that fact reaches the model?
- Lower the index refresh interval
- Switch the similarity to cosine
- Increase k so more chunks are passed to the generator Correct answer.
- Reduce the chunk overlap to zero
Explanation
If the relevant chunk ranks below the cutoff, increasing k brings it into the context window. The tradeoff is more tokens and possible distraction, so it should be combined with reranking.
Question 37Search and AI (vector, hybrid search, reranking, RAG)
Which statement about the num_candidates parameter is accurate?
- It sets how many candidate vectors each shard evaluates before selecting its top k Correct answer.
- It sets the final number of hits returned to the client
- It sets the number of replicas used for the search
- It sets the dimension of the query vector
Explanation
Each shard examines num_candidates approximate neighbors and then keeps its best k, which the coordinating node merges. Raising it generally improves recall at the cost of latency.
Question 38Search and AI (vector, hybrid search, reranking, RAG)
A hybrid search returns poor results because exact SKU strings rank low against semantically similar descriptions. Which adjustment best fixes this?
- Boost the lexical clause for matches on the SKU field Correct answer.
- Disable the rerank processor
- Lower num_candidates
- Increase the kNN k value
Explanation
Exact identifiers are best handled by lexical matching with a boost so exact SKU hits outrank semantically similar but incorrect products. Vector similarity alone tends to blur precise codes.
Question 39Search and AI (vector, hybrid search, reranking, RAG)
In a RAG system, what is the main risk of passing too many retrieved chunks to the language model?
- The embedding model retrains automatically
- The index shards rebalance during the query
- The context window fills with marginally relevant text, reducing answer focus Correct answer.
- The kNN search becomes exact instead of approximate
Explanation
Excess context consumes the model's window and can bury the relevant passage among distractors, which often lowers answer quality. Precision-oriented selection, often with reranking, mitigates this.
Question 40Search and AI (vector, hybrid search, reranking, RAG)
A dense_vector field uses cosine similarity. Which quantity is used to compare a query vector with stored vectors?
- The Euclidean distance between the vectors
- The angle between the vectors, ignoring their magnitudes Correct answer.
- The number of shared non-zero dimensions
- The element-wise product summed without normalization
Explanation
Cosine similarity measures the cosine of the angle between two vectors, so it is insensitive to vector length. Elasticsearch normalizes vectors for this similarity setting so that inner product yields the cosine value.
Question 41Search and AI (vector, hybrid search, reranking, RAG)
A search pipeline is configured with a rerank processor. What does the processor receive as input?
- The cluster state of the data nodes
- The top hits returned by the preceding query stage Correct answer.
- The ingest pipeline output for each new document
- The full inverted index of the target index
Explanation
A rerank processor operates on the results of the first retrieval phase, rescoring the top documents with a more expensive model. It does not see the index itself or ingest-time data.
Question 42Search and AI (vector, hybrid search, reranking, RAG)
When chunking a long policy document for a RAG index, which practice generally improves retrieval quality?
- Splitting on semantic boundaries with modest overlap between chunks Correct answer.
- Indexing the entire document as a single chunk
- Splitting every 20 tokens regardless of sentence boundaries
- Removing all headings and section titles
Explanation
Chunks aligned to natural boundaries keep related content together, and modest overlap preserves context that straddles a boundary. Very small or very large chunks tend to degrade retrieval precision or context relevance.
Question 43Search and AI (vector, hybrid search, reranking, RAG)
A team wants stricter grounding in RAG answers when retrieved evidence is weak. Which approach best reduces hallucination?
- Remove citations from the prompt
- Increase the generator temperature
- Always pass the maximum number of chunks
- Instruct the model to answer only from provided context and to abstain when evidence is insufficient Correct answer.
Explanation
Constraining the generator to the supplied context and permitting abstention prevents unsupported claims when retrieval is weak. Higher temperature or unbounded context increases the chance of fabricated content.
Question 44Search and AI (vector, hybrid search, reranking, RAG)
An analyst needs to compare two chunking strategies for a RAG corpus before any generation tuning. Which experiment design is most appropriate?
- Vary the embedding model and chunking together and compare answer fluency
- Compare only the total index size of each strategy
- Hold the query set and embedding model fixed, vary chunking, and compare recall@k Correct answer.
- Compare BLEU scores of generated answers only
Explanation
Isolating one variable, chunking, while fixing the query set and embedding model lets recall@k attribute differences to chunking alone. Changing multiple variables confounds the comparison.
Question 45Search and AI (vector, hybrid search, reranking, RAG)
A hybrid query returns strong results, but latency spikes when num_candidates is raised. Which explanation is most consistent?
- Each shard evaluates more candidate vectors, increasing graph traversal and scoring work Correct answer.
- The rerank model is retrained on each request
- The query vector dimension grows with num_candidates
- The index triggers a merge for every query
Explanation
num_candidates governs how many approximate neighbors each shard explores, so raising it increases traversal and scoring cost per shard. Recall improves but latency rises, which is the expected tradeoff.
Question 46Search and AI (vector, hybrid search, reranking, RAG)
A dense_vector field was indexed with vectors from model A, and queries are embedded with model B of the same dimension. Results are near-random. What is the most likely cause?
- The refresh interval is too long
- The index needs more primary shards
- The similarity setting must be changed to dot_product
- The two models place semantically similar text in different regions of vector space Correct answer.
Explanation
Matching dimensions are necessary but not sufficient: vectors from different models are not comparable because each model defines its own semantic geometry. Reindexing with the query model or embedding queries with the index model restores meaningful similarity.
Question 47Search and AI (vector, hybrid search, reranking, RAG)
A reranker improves nDCG@10 but overall RAG answer quality drops. Which explanation is most plausible?
- The reranker changed the stored document embeddings
- The reranker disabled lexical matching permanently
- The reranker promotes passages that score well against the query but omit the facts the generator needs Correct answer.
- The reranker reduced the index refresh rate
Explanation
A reranker optimizes query-passage relevance, which can favor topically similar passages over ones containing the specific answer facts. Evaluating with answer-level metrics and tuning the candidate set addresses this mismatch.
Question 48Search and AI (vector, hybrid search, reranking, RAG)
Which design best keeps a RAG assistant's answers current when source documents change frequently?
- Rely on the language model's pretrained knowledge for recent changes
- Rebuild the entire index from scratch on every document edit
- Increase the number of replicas for the vector field
- Continuously ingest updates through an ingest pipeline that regenerates embeddings, then refresh the index Correct answer.
Explanation
An ingest pipeline with an inference processor regenerates embeddings for changed documents, and refreshing makes them searchable, keeping retrieval aligned with the source. Depending on model memory or full rebuilds is either stale or wasteful.
Question 49Search and AI (vector, hybrid search, reranking, RAG)
In an Elasticsearch hybrid search, which component is responsible for combining the BM25 lexical relevance score with the dense vector similarity score into a single ranked result set?
- The reciprocal rank fusion (RRF) or linear score-combination stage that merges the two ranked lists Correct answer.
- The knn section's num_candidates parameter, which normalizes scores across both query types
- The dense_vector field mapping, which stores both the lexical terms and the embeddings in one structure
- The index refresh interval, which synchronizes lexical and vector scores before returning hits
Explanation
Hybrid search runs a lexical query and a kNN query separately and then merges their ranked outputs. Elasticsearch provides RRF (rank-based) and linear combination (score-based) to produce the final ordering. The merge stage, not the field mapping or refresh, is what unifies the two result sets.
Question 50Search and AI (vector, hybrid search, reranking, RAG)
A RAG pipeline retrieves the top 20 chunks for each user question, but users report answers that miss evidence located in chunk 14. Latency budget rules out increasing top-k. Which change most directly targets this recall problem?
- Reduce the chunk size to a single sentence so that each chunk carries less competing content
- Switch the dense_vector similarity from cosine to dot_product to rescale the stored vectors
- Increase the index refresh interval so that newly ingested chunks become searchable more frequently
- Add a reranking step that reorders a larger candidate set before selecting the final chunks passed to the model Correct answer.
Explanation
Lower-ranked relevant chunks are being dropped because the initial retrieval cut off too early. Retrieving a wider candidate pool and reranking it lets strong evidence like chunk 14 surface without sending more chunks to the model. This preserves the latency budget while improving recall at the generation stage.