Skip to content

fix(server): name search in contact_get/product_get returns empty (drop 'like' wildcards) - #2

Merged
Vitexus merged 1 commit into
mainfrom
fix/like-substring-no-wildcards
Jul 3, 2026
Merged

fix(server): name search in contact_get/product_get returns empty (drop 'like' wildcards)#2
Vitexus merged 1 commit into
mainfrom
fix/like-substring-no-wildcards

Conversation

@Vitexus

@Vitexus Vitexus commented Jul 3, 2026

Copy link
Copy Markdown
Member

Fixes #1.

Problem

contact_get(nazev=...) and product_get(nazev=...) always returned an empty set. They built the filter as nazev like '*{nazev}*'.

Root cause

AbraFlexi's like operator is a plain case-insensitive substring match and takes no wildcards. The *...* wrapping made AbraFlexi look for a literal * inside the value, so nothing ever matched.

Verified directly against raw AbraFlexi REST (record nazev = "AAA Tondaaa"): like '*Tond*' and like '%Tond%' → 0 rows, while like 'Tond', like 'ondaa' (mid-string) and like 'tond' (lowercase) → 1 row.

Fix

Pass the term as a bare substring: nazev like '{nazev}'. Applied to both contact_get (adresar) and product_get (cenik).

Verification (production)

  • Before: contact_get(nazev="Voda")[]
  • Correct query proven equivalent: evidence_get(evidence="adresar", filter_expr="nazev like 'Voda'")Vodafone Czech Republic a.s.

The evidence_get/evidence_list filter_expr passthrough is unaffected — it forwards raw expressions correctly.

Summary by CodeRabbit

  • Bug Fixes
    • Improved name-based search for contacts and products so partial matches now work as expected without requiring special wildcard formatting.
    • Search behavior is now more intuitive and consistent, avoiding cases where search terms were treated literally.

…t_get queries

AbraFlexi 'like' is a plain case-insensitive substring match and takes no
wildcards; wrapping the term in '*...*' made contact_get/product_get name
searches match a literal '*' and always return empty.

Fixes #1
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eca7f8bd-9e65-4c41-8fe0-5519294bd50c

📥 Commits

Reviewing files that changed from the base of the PR and between 06cf4c8 and 3437c67.

📒 Files selected for processing (1)
  • abraflexi_mcp_server/server.py

📝 Walkthrough

Walkthrough

The filtering logic for the nazev parameter in contact_get and product_get was changed to pass the search term as a raw substring instead of wrapping it in wildcard asterisks, aligning with AbraFlexi's like operator semantics. Explanatory comments were added.

Changes

nazev filter fix

Layer / File(s) Summary
Fix nazev like filter construction
abraflexi_mcp_server/server.py
contact_get and product_get now build the nazev filter as like '{nazev}' instead of like '*{nazev}*', with comments explaining that AbraFlexi's like operator does not support wildcards.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Related issues:

  • #1: contact_get/product_get name search always returns empty due to wildcard-wrapped AbraFlexi like filter.

Suggested labels: bug, backend

Suggested reviewers: VitexSoftware maintainers

🐰 A wildcard once hid the name,
No match was found, oh what a shame,
Now stripped away, the search runs true,
"Voda" finds Vodafone anew,
Hop, hop, the filter's fixed again!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fix: removing wildcards from name search in contact_get/product_get.
Linked Issues check ✅ Passed The PR matches issue #1 by making contact_get and product_get use bare 'like' substrings instead of wildcard-wrapped terms.
Out of Scope Changes check ✅ Passed The only changes are the intended filter fix and explanatory comments; no unrelated behavior changes are apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/like-substring-no-wildcards

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Vitexus
Vitexus merged commit bf44d78 into main Jul 3, 2026
1 of 4 checks passed
@Vitexus
Vitexus deleted the fix/like-substring-no-wildcards branch July 3, 2026 14:03
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.

contact_get/product_get: name search always returns empty (wildcards wrapped around AbraFlexi 'like')

1 participant