• Hi,

    Is there a way to search a text field based on range? I want users to be able to search between a range of Heights, and have entered each option as a text field which specifies the height in ft and cm. I have also selected the Sort Order as Custom, so that the fields in the dropdown are displayed in the order I wish (e.g. 5’2″ appears before 5’11”). Can I can search based on this order?

    Many thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hi mikee1001,

    That’s a good question, but unfortunately the answer is no. The custom sort order affects only the display order of the values, but it doesn’t affect the database search, that currently works for decimal and integer numbers only.

    So at this moment the only way to search for a range of heights is to use a numeric field, containing the height in centimeters.

    Thread Starter Mike

    (@mikee1001)

    Thanks Andrea. Do you think it is possible to implement a second column in admin, next to the Default Value setting, which can act as sort order column for use when searching a range of Strings? Or another way could be to enter the sort order in decimals in the main column (e.g. 1 to 10), and then have a column next to it where the user enters a different value they wish to display for each field (e.g. 10 different Strings)?

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi Mike,

    Probably a good option to implement the range search when values are given in US customary units could be to build a new custom profile field type, called e.g. ‘US height’, together with its own interface to BP Profile Search. It’s not an easy project, as it requires writing a separate plugin, but I can’t think of a simpler solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Searching a range with text fields’ is closed to new replies.