• Resolved Christine321

    (@christine321)


    Hi,
    I use 2 shortcodes in the same page test

    [pdb_search columns="last_name" target_page="test" target_instance=2 ]
    
    [pdb_list fields="last_name,first_name" filter="id=0" orderby="last_name" order="asc"]

    an I have checked the “Strict User Searching” setting.

    When I search a string like B, the list contains all the records which contain the string B in the last_name field and I’d like to show only the ones which start with B, in fact to do like the search B*. How can I manage?
    I’d like to force the length of the search with at least 3 letters, I mean no to allow a search with only B or C … Is it easy to do?
    Thank you

    https://www.ads-software.com/plugins/participants-database/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    You won’t need “strict user searching” for this: a search like “B*” will give all the records in the searched field that begin with “B”

    You can’t set the field to search on in the search shortcode (it’s a good idea, but it doesn’t work that way) so the user has to select which column to search on.

    As to requiring the search to be a certain number of characters or more, this can be done, but it would require a custom template and a bit of javascript.

    Thread Starter Christine321

    (@christine321)

    Thank you for your answer.
    I understand for the second part of my question (a certain number of characters) –> require some development.

    I’m not sure to be clear for what I need in my first question: I’d like when I submit “B” to have only the records which begin with “B”, in fact to force the search to do a “B*”
    Example:
    when I search “B” now I have
    Abbot
    Ambrose
    Brigham
    Buck
    Bud

    And I’d like (when I search B) to have
    Brigham
    Buck
    Bud

    I’m sorry for my english, I hope you’ll understand what I need.

    Plugin Author xnau webdesign

    (@xnau)

    Yes, type B* into the search field and you’ll get all matches that begin with B

    Thread Starter Christine321

    (@christine321)

    Hi
    I’ve found what I need by changing the operator and delimiters.

    Example
    Abbot
    Ambrose
    Brigham
    Bruce
    Buck
    Bud
    When I search “Br” I have “No Results” as expected
    When I search “Br*” I have all the results which start with Br et not Ambrose
    When I search “Bruce” I have a strict search.

    Everything ok for me, you can close the post.
    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Search start with a string’ is closed to new replies.