• Resolved jaffster

    (@jaffster)


    We have the plugin setup to only show 1 row (about 2500 entries), and we want the search to act as an exact search string, not as “including”.

    For example, we have the following entries:
    9 Maiden St
    19 Maiden St

    When we type into the search 19 Maiden, it shows 9 Maiden as the first result, instead of 19 Maiden…it seems its sorting the results by a specific column and not related to the search query.

    How can we make the search act as an exact string search field to show results sorting accordingly? Thanks!

    https://wordpress.org/plugins/tablepress/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jaffster

    (@jaffster)

    Also, I installed the Datatables Sorting plugin but am not sure what command to use to make this sort by exact string input. Column to sort is the first column (0).

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean, but unfortunately, I’m not aware of a solution to this 🙁
    The current way is simply how the filtering works in the external DataTables JS library from http://www.datatables.net/ that TablePress uses for this.
    I don’t think that it offers a direct way for such an exact search string, but as I’m not the developer of the library, I’m not entirely sure.

    Regards,
    Tobias

    Thread Starter jaffster

    (@jaffster)

    Thanks for the quick response. It seems silly though that you could not search for the exact string and only display matching cells that contain those characters.

    So if I have ‘9 Maiden’ and ’19 maiden’ and i search for ’19 maiden’ it will show ‘9 maiden’ first because it includes ‘9 maiden’ but is numerically sorting it first.

    Who would I contact to determine a tweak to the sorting method?

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    The “9 maiden” entry is shown because it matches the “maiden” part of the search string.
    Then, the search is a filtering, which will not perform a sort on the data, i.e. the filtering will simply remove the rows that don’t match from the result set.

    You could maybe play around with the quotation marks, i.e. actually including them in the search string and search for

    "19 maiden"

    For more information on this, you could try the documentation or the support forums for DataTables at http://www.datatables.net/

    Regards,
    Tobias

    Thread Starter jaffster

    (@jaffster)

    Quotes are not working.

    I typed in “9 maiden lane” and “49 maiden lane” showed up first.

    It looks like wpDataTables plugin has a stronger search algorithm/coding, we’re going to have to switch to that plugin.

    Someone should really build a simple search extension/plugin, its definitely needed because the rest of the plugin is solid.

    Thanks!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    “49 maiden lane” shows up above “9 maiden lane”, because the table is not sorted in your desired order to begin with.

    wpDataTables uses the exact same DataTables JS library for the filtering, so it will show the same behavior.

    Sorry that I can’t really help here 🙁

    Regards,
    Tobias

    Thread Starter jaffster

    (@jaffster)

    Yea, oddly enough it doesn’t have the exact same behavior, so they must have done something a bit differently…but its still not solving our issue.

    We coded a work around for the time being. Thanks!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    I’m not sure how they’d have done that, but I also don’t know wpDataTables very well.
    Good to hear that you found that work around!

    Best wishes,
    Tobias

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Search for exact string not 'including'’ is closed to new replies.