Conversation
Add support for advanced querying using AND/OR combinations, custom comparison operators, and nested conditions. Updates include new data classes and expanded logic to handle complex search criteria.
… objects Implement a `parse_query` function and a recursive descent parser to handle complex query strings. Supports advanced syntax including logical operators, comparison operators, parentheses, and quoted literals.
…y and query parsing
Revamp tokenization and context detection methods to provide more accurate and comprehensive autocomplete suggestions. Refactor input handling to better support advanced query syntax with enhanced parsing for operators, values, and grouping.
Enable searchable fields directly from the Host model ("meta" section). Update field discovery, query building, and value extraction to integrate meta fields alongside facts and metrics.
…ling Add dynamic query highlighting with syntax-aware formatting in advanced search input. Synchronize input and highlight scroll. Update styles to support better visual hierarchy and readability.
Enhance logic to detect and handle cases where a token partially matches a valid field followed by a space. Prevents incorrect operator suggestions and provides more accurate context detection.
Introduced support for saving advanced search queries. Added models, views, templates, and forms for creating, editing, listing, and deleting saved searches. Integrated "Save Search" and "Saved Searches" options into the advanced search UI.
Updated advanced search syntax to use brackets `{}` instead of parentheses `()`. Adjusted the tokenizer, parser, suggestions, and validation logic to handle the new grouping syntax. Updated related examples, comments, and UI elements for consistency.
Modified examples in the advanced search page to reflect the updated syntax for grouping conditions with brackets `{}` instead of parentheses `()`. Ensured all relevant examples and descriptions are consistent with the new syntax.
Introduced `valueType` property for advanced search fields to specify field types. Updated tokenizer, suggestions, and validation logic to handle type-based operator and value suggestions. Improved field filtering and operator applicability based on field types.
Reorganized tokenizer logic to separate text tokenization from caret-specific operations. Introduced `_tokenizeText` for generic tokenization and updated `_tokenizeUpToCaret` to reuse it. Improved context determination by adding support for parsing tokens before partial inputs.
Switched the search input field to a resizable textarea in advanced search. Updated the associated styles and behavior to maintain compatibility with existing features, including the highlight overlay and suggestion handling. Improved layout flexibility for multiline queries.
Added array field aggregation functions (min, max, sum, concat, count) to advanced search. Updated the tokenizer, context handling, suggestions, and UI examples to include syntax and usage for array aggregations. Enhanced query builder to generate SQL expressions for aggregation operations.
Wrapped `search_hosts_by_scan_fields` in a try-except block to catch `ValueError`. Added logic to store the error message and return an empty queryset when parsing fails.
Updated the explanatory text in the advanced search template to improve readability and adjust the tone. Replaced "written 90% by AI" with "vibe coded" for consistency and a more user-friendly phrasing.
Added `font-semibold` class to the highlight overlay in advanced search to ensure consistent styling. Also updated `tailwind.css` to include the necessary utility for this change.
Introduced comprehensive test cases for the advanced search feature, covering various query criteria such as FQDN, department, archived status, billable status, OS, hardware specifications, memory, and virtualization type. These tests ensure the robustness and reliability of the search feature.
Updated `_build_array_expansion_clauses` to include optional type check clauses ensuring JSONB expressions represent arrays. Refactored parameter handling to separate FROM, WHERE, and HAVING clauses for better maintainability. Enhanced SQL query construction to prevent scalar errors during array expansions.
Updated textarea logic to prevent incorrect tab behavior when Shift is held. Replaced unsafe template value rendering with `escapejs` for improved security. Enhanced whitespace handling in JS tokenizer and parser to include newlines. Added `autoResize` functionality to update visual consistency.
Removed support for dict-based criteria in `search_hosts_by_scan_fields`. Updated the function to exclusively handle `ComplexQuery` objects for clearer and more maintainable query building. Adjusted related documentation and examples to reflect these changes.
Replaced direct `autoResize` call with `$nextTick` to address potential asynchronous rendering issues. Ensures proper resizing of elements after DOM updates for better stability.
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.
No description provided.