Using quotes in Site Search

Most of my treepl sites have a search function for visitors to the site to use. If a visitor uses quotes in the search field, however, a liquid parsing error occurs. For example, I’m trying to find all pages on the megasorber.com website that mention the product code “FM H”. If I use quotes in the search field I get the error message: Liquid Error: Cannot parse ‘Name:*"FM’: Lexical error at line 1, column 10. Encountered: after : "“FM”

Search functions usually allow for searches using quotes. Is this a bug? Is there something in the coding of the search function that I could change to enable the use of quotes?

As a temporary fix, you could perhaps use javascript to remove the " character.
Either as they type:
https://stackoverflow.com/questions/43591256/remove-character-from-input-field-while-user-is-typing-keyup/43591285

Or during the onSubmit event by removing the character from the input field before submission.
Something like this (not well tested):

<script>
$('#YOUR-FORM-ID').submit(function( event ) {
    var el = $(this).find('[name="SearchKeyword"]'),
        str = el.val(),
        res = str.replace(/"/g, '');
        $(el).val(res);
});
</script>

I think in @hopestew’s use case the quotes are supposed to trigger a search of exactly that term, right? If I search for more then one word in Treepl though (without quotes), I get results with those words, but not necessarily in that combination. Searching for FM and H as in the example would result in results containing FM and H somewhere in the document.
So the problem is not so much the quotes themselves, but what they’re supposed to do within search - which is not possible in Treepl yet.

Yes, I needed to search exactly for the term “FM H” which is a product code. When the site search didn’t work, I downloaded all pages into Dreamweaver and did a ‘find all’ search there. Luckily, the site does not (yet) use much in the way of custom modules otherwise I would have had export items and do a separate search in each spreadsheet.

I do feel that site search should allow for the use of quotes in order to search for exact terms.