-
Notifications
You must be signed in to change notification settings - Fork 92
gppa-fuzzy-match-property.php
: Added new snippet that adds a "Fuzzy Match" property available to all object types.
#1159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@claygriffiths has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 20 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds a new singleton class that registers a global “Fuzzy Match” property for all GPPA object types and applies fuzzy matching to object query results via WordPress filters. Implements multi-algorithm similarity scoring, template-driven content extraction, and supports contains/does_not_contain operators during result filtering. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant WP as WordPress
participant GPPA as GP Populate Anything
participant Fuzzy as GPPA_Fuzzy_Match_Property
participant ObjType as Object Type Instance
Note over Fuzzy: Initialization
WP->>Fuzzy: init()
Fuzzy->>WP: add_filter(gppa_object_type_properties)
Fuzzy->>WP: add_filter(gppa_object_type_query_results)
Note over GPPA,ObjType: Query lifecycle
GPPA->>ObjType: fetch_objects(args)
ObjType-->>GPPA: objects[]
GPPA->>Fuzzy: apply_fuzzy_matching(objects[], object_type_instance, args)
alt Fuzzy filters present
Fuzzy->>Fuzzy: extract fuzzy filters from args.filter_groups
loop For each fuzzy filter
Fuzzy->>Fuzzy: expand value (field values, replace_gf_field_value)
Fuzzy->>Fuzzy: extract_searchable_content(objects[])
Fuzzy->>Fuzzy: fuzzy_search(content[], query)
Fuzzy-->>Fuzzy: matched set (scored/sorted)
Fuzzy->>Fuzzy: include/exclude per operator (contains / does_not_contain)
end
Fuzzy-->>GPPA: filtered objects[]
else No fuzzy filters
Fuzzy-->>GPPA: original objects[]
end
GPPA-->>WP: final objects[]
Note right of WP: Results rendered
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
c29fa76
to
14700c2
Compare
… Match" property available to all object types.
14700c2
to
10ae594
Compare
Summary
Added new snippet that adds a "Fuzzy Match" property available to all object types.
Utilizes Fuse-like logic to search through returned objects.
Depends on https://github.com/gravitywiz/gp-populate-anything/commit/949ab5a471c27c9d2837bc8c07cf89963c11109f
Known Limitations