Mountain Project Logo

Search function needs to trim extra spaces at the end of queries


Original Post
khoa · · Tacomarado · Joined Mar 2007 · Points: 50

When using the search feature on the app, some smartphones/keyboard apps will add an extra space after the current word (especially with autocorrect). 

Example, i type "outer space" but "outer space " is actually typed out. The search function takes the extra space literally and queries MP for "outer space " which returns no results. 

Ideally when querying, it should strip out this extra space at the end. Something like the php equivalent of rtrim() is what it should do.

Marc801 C · · Sandy, Utah · Joined Feb 2014 · Points: 65

khoa wrote:

When using the search feature on the app, some smartphones/keyboard apps will add an extra space after the current word (especially with autocorrect). 

Example, i type "outer space" but "outer space " is actually typed out. The search function takes the extra space literally and queries MP for "outer space " which returns no results. 

Ideally when querying, it should strip out this extra space at the end. Something like the php equivalent of rtrim() is what it should do.

Not just that - MP search overall needs tons of love. In particular, it needs to be able to handle misspellings, fuzzy search, and overall not be so literal. As a starting point, use the sql LIKE keyword in queries and not absolute equivalence.

Rachel Vecchitto · · Boulder, CO · Joined Nov 2011 · Points: 10

khoa wrote:

When using the search feature on the app, some smartphones/keyboard apps will add an extra space after the current word (especially with autocorrect). 

Example, i type "outer space" but "outer space " is actually typed out. The search function takes the extra space literally and queries MP for "outer space " which returns no results. 

Ideally when querying, it should strip out this extra space at the end. Something like the php equivalent of rtrim() is what it should do.

I can't reproduce this... what search box are you seeing this behavior from? The one in the header, on the search page itself, somewhere else... ?

khoa · · Tacomarado · Joined Mar 2007 · Points: 50

Rachel Vecchitto wrote:

I can't reproduce this... what search box are you seeing this behavior from? The one in the header, on the search page itself, somewhere else... ?

(android) app -> home screen -> search -> routes or areas (happens for both)


The website search seems to be working fine

Rachel Vecchitto · · Boulder, CO · Joined Nov 2011 · Points: 10

Ah, thanks. Noted... we'll get it fixed next time we release the app.

Guideline #1: Don't be a jerk.

Post a Reply to "Search function needs to trim extra spaces at t…"
in the iPhone & Android App Feedback

Log In to Reply