Repository navigation
Conversation
Collaborator
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates Timesketch to disable wildcard search mode on sketches that mix wildcard-mapped and non-wildcard-mapped indices, preventing wildcard queries from silently returning zero hits. It includes backend updates to the OpenSearch datastore, frontend adjustments to default to query string mode, and new end-to-end and unit tests. Feedback on the changes identifies a potential AttributeError in timesketch/lib/datastores/opensearch.py when retrieving properties from index mappings, recommending defensive dictionary checks to prevent potential API crashes.
jaegeral
force-pushed
the
2026-11-23_ip-wildcard-search
branch
from
November 23, 2026 16:30
9b055d3 to
3cfa330
Compare
…ests - Preserve wildcard mode when an empty/buffering generic.mappings index has wildcard dynamic_templates and no non-wildcard text fields yet - Tighten legacy ES 6.x fallback to select only dicts containing properties - Add set[str] type annotations and update get_wildcard_fields docstring - Add Vitest coverage for Explore.vue searchMode fallback when supports_wildcard is false - Poll for OpenSearch refresh in ui_test.py and tighten E2E assertions in wildcard_query_test.py
berggren
approved these changes
Nov 25, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes mixed wildcard / non-wildcard timelines silently returning
0hits in Wildcard (WC) search mode:timesketch/lib/datastores/opensearch.py):OpenSearchDataStore.get_wildcard_fields()previously took the union of wildcard fields across all indices even when one or more indices lacked.wildcardsubfields (e.g., pre-wildcard timelines orManual events). That keptmeta.supports_wildcard = Trueon mixed sketches and caused Wildcard queries to silently return0hits for non-wildcard timelines while Query String (QS) mode returned all hits.get_wildcard_fields()now returns[]whenever any queried index has no mappings/properties or zero wildcard fields, while preserving the union of wildcard fields when all queried indices support wildcard search (so heterogeneous schemas such as EVTX + HTTP timelines retain all of their wildcard fields).Explore.vuesearchModegetter onmeta.supports_wildcard(timesketch/frontend-ng/src/views/Explore.vue):!this.meta || !this.meta.supports_wildcardbefore consultinglocalSearchModeso adding a non-wildcard timeline immediately falls back toquery_string.Testing
timesketch/lib/datastores/opensearch_test.py): addedtest_get_wildcard_fields_mixed_indicesandtest_get_wildcard_fields_multiple_wildcard_indices(covering mixed indices, union across distinct wildcard-enabled indices, and missing mappings).end_to_end_tests/wildcard_query_test.py): addedtest_wildcard_ip_search_mixed_indicescheckingsupports_wildcardisFalseandexplore_wildcardrejects mixed indices rather than silently returning0hits.end_to_end_tests/ui_test.py): addedtest_08_mixed_timelines_wildcard_ip_searchtesting a mixed CSV +Manual eventssketch disables Wildcard mode and finds*<ip>*matches in Query String mode.black --check,pylint --rcfile=.pylintrc, andyarn run eslintpassed with 0 errors.