Why is my search returning more results than expected?

When using a dropdown search filter in GravityView, you may notice that selecting one option returns entries that should belong to a different option. This guide explains why this happens and how to fix it.

Understanding the Problem

GravityView's search performs a partial match on field values. This means if one choice's text appears inside another choice's text, both will be matched.

Example: You have a "Payment Status" dropdown with two choices: "Paid" and "Unpaid". When a visitor selects "Paid" from the search filter, they expect to see only paid entries. Instead, they see both "Paid" AND "Unpaid" entries.

This happens because "Unpaid" contains the word "Paid" within it:

  • Searching for "Paid" → matches "Paid" ✓
  • Searching for "Paid" → also matches "Unpaid" ✗

The Solution

The fix involves two parts:

  1. In Gravity Forms: Assign each choice a unique value that doesn't appear inside any other value
  2. In GravityView: Display the label (friendly name) instead of the value

This way, the search uses distinct values behind the scenes, while visitors still see the readable labels.


Step 1: Configure Distinct Values in Gravity Forms

  1. Open your form in the Gravity Forms editor, select the dropdown (or radio/checkbox) field you want to fix, and in the field settings, click the Edit Choices button
  2. Under Options, check the Show Values checkbox (2). This reveals a "Value" column next to each choice
  3. Enter distinct values that don't contain each other (3):
    • Paid → value: yes
    • Unpaid → value: no

Once you're done, close the choices editor and Save the form.

Important: The values must not contain each other. For example, using "paid" and "unpaid" would NOT work because "unpaid" still contains "paid". Using "yes" and "no" ensures they are completely distinct.


Step 2: Display Labels in GravityView

After changing the values in Gravity Forms, the View will display "yes" and "no" instead of "Paid" and "Unpaid". To show the friendly labels to visitors:

  1. Edit your View in GravityView
  2. Find the Payment Status field and click the gear icon to open field settings
  3. Scroll down to the Display section
  4. Look for "What should be displayed?" — this option appears because the field now has separate labels and values
  5. Select Label of the input
  6. Click Close to save the field settings
  7. Update the View


Result

After completing both steps:

  • Visitors see "Paid" and "Unpaid" in the View and search dropdown (the labels)
  • When they filter by "Paid", the search looks for "yes" (the value)
  • "yes" is not contained in "no", so only the correct entries are returned

Note: We're working on a GravityView update that will improve search matching to handle these cases automatically. We'll update this article when that's available.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us