How to make a search automatically appended with wildcard

34 views
Skip to first unread message

Roman Serazhiev

unread,
Feb 11, 2014, 2:42:48 PM2/11/14
to scroll-vi...@googlegroups.com

Hi,

Is it possible somewhere in the code or Viewport settings to make searching for a phrase (or user) automatically append with a wildcard ("*") at the end?

For now, if I go to user search and search for "Jon", it gives me different amount of results compared to "Jon*". What we want is to have the same search results if we are searching with * or without.

Thank you.

Cheers,
Roman.


Roman Serazhiev
Solutions Specialist
Catch Software

Enterprise Tester 4.9 - Customized Test Management & Execution: enterprisetester.com/whats-new

Stefan Kleineikenscheidt (K15t Software)

unread,
Feb 12, 2014, 12:32:23 PM2/12/14
to Roman Serazhiev, scroll-vi...@googlegroups.com

Not in Viewport directly, and I doubt it should be part of the template rendering.

Instead, I think this should be done in JavaScript. If you use jQuery, this one should work (not tested):

$('#my-form-id').submit(function() { 
    var searchFieldValue = $('#my-search-field-id').val();
    $('#my-search-field-id').val(searchFieldValue + '*'); 
});

Of course, this example needs to be extended to works not only for the last term.

Cheers,
-Stefan




--
You received this message because you are subscribed to the Google Groups "Scroll Viewport Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scroll-viewport...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Roman Serazhiev

unread,
Feb 12, 2014, 7:45:14 PM2/12/14
to scroll-vi...@googlegroups.com
Thanks Stefan,

it worked!

Cheers.


On Wednesday, February 12, 2014 8:42:48 AM UTC+13, Roman Serazhiev wrote:

Hi,

Is it possible somewhere in the code or Viewport settings to make searching for a phrase (or user) automatically append with a wildcard ("*") at the end?

For now, if I go to user search and search for "Jon", it gives me different amount of results compared to "Jon*". What we want is to have the same search results if we are searching with * or without.

Thank you.

Cheers,
Roman.


Roman Serazhiev
Solutions Specialist
Catch Software

Roman Serazhiev

unread,
Feb 16, 2014, 5:37:10 PM2/16/14
to scroll-vi...@googlegroups.com
Hi Stefan,

Hope you had a good weekend!

I wanted to ask a question related to this post.
I have made "*" automatically append to search request, however, when I search for "mark" (to find a person, called Mark) in user search on the first page I have not Marks, but people with other names, but who are in marketing department.
I understand that it is how it should be (because we user "*" at the end of the request), but it would be great to have an option in Viewport to make it display the results containing this exact word on the first pages, and the results that has a part of this word in further searches.
So, if I am searching for "mark*", at the beginning of search results I would have people with the name Mark, then I would have Marketing team, Marketing department and so on.

If Viewport can't do it for now, it would be great to have this enhancement in future versions.

Thanks.
Cheers,
Roman.

Stefan Kleineikenscheidt (K15t Software)

unread,
Feb 19, 2014, 3:11:52 PM2/19/14
to scroll-vi...@googlegroups.com

Hi Roman,

that's right. I've created an issue here (easy fix, should make it into 1.1.1): https://k15t.jira.com/browse/VPRT-166

As a workaround you can use JavaScript to manipulate the query string (i.e. turn "Mark*" into "Mark Mark*"). Does that make sense?

Cheers,
-Stefan
Thanks Stefan,

it worked!

Reply all
Reply to author
Forward
0 new messages