Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 18, 2025

This PR adds a comprehensive test suite that demonstrates and validates the search functionality in HPCC Platform for the term "foo". The implementation showcases multiple search approaches available in the platform.

Changes Made

Test Files Added

  1. testing/regress/ecl/search_foo.ecl - Basic string search demonstration

    • Uses REGEXFIND for pattern matching
    • Uses Std.Str.Find for position-based search
    • Compares results between different search methods
    • Validates that multiple approaches yield consistent results
  2. testing/regress/ecl/textsearch_foo.ecl - Advanced text search using TextSearch module

    • Demonstrates boolean search operators (OR, AND, ANDNOT)
    • Shows phrase searching capabilities
    • Includes proximity and M-of-N matching examples
    • Leverages existing $.Common.TextSearch infrastructure
  3. testing/regress/ecl/search_foo_comprehensive.ecl - Comprehensive search patterns

    • Exact matching (case sensitive and insensitive)
    • Contains, starts-with, and ends-with patterns
    • Word boundary matching with regex
    • Multiple validation approaches with result counting
  4. Expected output files in testing/regress/ecl/key/ for test validation

Search Methods Demonstrated

The test suite covers all major search capabilities:

// Basic string search
containsMatch := sampleData(Str.Find(text, 'foo', 1) > 0);

// Regex pattern matching
regexMatch := sampleData(REGEXFIND('foo', text));

// Advanced text search with boolean logic
fooQueries := DATASET([
    {'"foo"'},                              // Simple search
    {'OR("foo", "bar")'},                   // Boolean OR
    {'AND("foo", "bar")'},                  // Boolean AND
    {'PHRASE("foo", "bar")'},               // Phrase search
    {'PROXIMITY("foo", "bar", 5, 5)'}       // Proximity search
], TextSearch.queryInputRecord);

Testing & Validation

  • Follows existing HPCC Platform test structure and conventions
  • Includes proper expected output XML files for regression testing
  • Demonstrates multiple approaches to validate search accuracy
  • Can be executed using the existing ecl-test framework

This implementation provides working examples for developers who need to implement search functionality for "foo" or similar terms in their ECL programs, while also serving as regression tests to ensure the platform's search capabilities continue to work correctly.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 18, 2025 14:44
…examples

Co-authored-by: g-pan <910274+g-pan@users.noreply.github.com>
…uite

Co-authored-by: g-pan <910274+g-pan@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] search for foo Add comprehensive test suite for searching "foo" functionality Sep 18, 2025
@Copilot Copilot AI requested a review from g-pan September 18, 2025 14:48
Copilot finished work on behalf of g-pan September 18, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants