Add comprehensive test suite for searching "foo" functionality
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
-
testing/regress/ecl/search_foo.ecl- Basic string search demonstration- Uses
REGEXFINDfor pattern matching - Uses
Std.Str.Findfor position-based search - Compares results between different search methods
- Validates that multiple approaches yield consistent results
- Uses
-
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.TextSearchinfrastructure
- Demonstrates boolean search operators (
-
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
-
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-testframework
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.