Skip to content

Updated AutoTable to clear sort state when the search value changes #869

Closed
MillanWangGadget wants to merge 1 commit into
mainfrom
mill/clearSortStateOnSearch
Closed

Updated AutoTable to clear sort state when the search value changes #869
MillanWangGadget wants to merge 1 commit into
mainfrom
mill/clearSortStateOnSearch

Conversation

@MillanWangGadget

@MillanWangGadget MillanWangGadget commented Jun 22, 2025

Copy link
Copy Markdown
Contributor
  • UPDATE
    • Discord user reported that their AutoTable search results were not ordered based on search similarity, and that sort state was applied to the search results
    • This happens because the API still applies the sort to the search results, which feels correct. It would be surprising to pass a sort param that gets ignored once you also add a search
    • This problem is most apparent when you search by email address because the @ character is a special elastic search char that acts kinda like an OR
      • Example
        • Search for email_123@example.com
        • Elastic search interprets this as (contains "email_123") OR (contains "example.com")
        • A lot of extra results appear for anything that includes example.com
        • If there is an uncleared column based search that puts those other example.com records above the perfect match email_123@example.com, it feels wrong
    • Now, you can still column sort with an active search, but changing the search will clear the column sort to avoid the above situation

CleanShot 2025-06-22 at 18 03 25

…o that the order of results is ordered by search similarity instead
@infiton

infiton commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

this sounds like the correct behaviour but lets get a gutcheck from @mdamy

@MillanWangGadget

Copy link
Copy Markdown
Contributor Author

Closing this because it's gonna be annoying if you're sorting by fieldB and searching for something in fieldA. This is a bigger infrastructure concern with how searches get tokenized

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