Announcement

Collapse
No announcement yet.

"S" at the end of internal search

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    "S" at the end of internal search

    Hi there,

    Took a while looking around the forum but to no avail.

    Anyone know of a coding shortcut that could automatically remove an "s" from the end of internal searchs?

    For example: Someone searches for "mugs" on our website and gets 3 results (because I mistyped the word mugs in the title of the product). Search for mug and you get 147 results. Is there a way I can set the search engine to ignore the letter s at the end of a search term?

    Also, is it possible to tag products to help enable internal search?

    Thanks in advance.
    Michael Smith
    http://www.mensgiftshop.com

    #2
    The usual idea with that is to go plural on everything and both singular and the plural searches are covered then. This is the same with search engines. Can you not reverse your thinking and go globally plural, easier to do, better and won't involve coding that could get pretty complicated if at all possible.

    Setting up rules to identify whether a word ending in s is a plural or not could be somewhat challenging.

    Comment


      #3
      Automatically removing trailing "s" from search terms.

      For the Simple Search on the Overall layout. Replace:
      Code:
      	<form name="simplesearch" method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
      with:
      Code:
      	<form name="simplesearch" method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />" 
      		onsubmit="this.SS.value = this.SS.value.replace(/s$/i, ''); return true;">
      In layouts Search Results Page Bulk Area and Search Page Bulk Area, replace:
      Code:
      	<form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
      with:
      Code:
      	<form method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />"
      		onsubmit="this.SS.value = this.SS.value.replace(/s$/i, ''); return true;">
      And, as Lee points out it won't care if a word is a plural or not. So you may get extra results that are not quite intended.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Nice one Norman, I guess with not so many words ending in s that are not plural words, a global remove the s is not such a bad thing. Probably going to serve him much better than his current situation.

        Michael: Just make sure you are thinking about the search engines too, if the internal search engine struggles to find the product, other search engines might do too.

        Comment


          #5
          Originally posted by leehack View Post
          Nice one Norman, I guess with not so many words ending in s that are not plural words, a global remove the s is not such a bad thing. Probably going to serve him much better than his current situation.

          Just make sure you are thinking about the search engines too, if the internal search engine struggles to find the product, other search engines might do too.
          The internal search engine is limited by product title and description. Global search engines are not, so sections that have plurals and tags are pretty much covered. Would be nice to see Tags introduced in the future for internal search though.
          Michael Smith
          http://www.mensgiftshop.com

          Comment


            #6
            You may be able to use the 'searchable properties' feature, give that a try, maybe a variable into which you put you tags and make it searchable? settings > search settings for defining, details on this facility in the help are pretty good from memory.

            PS - if your site structure is setup correctly, you'll have correct headings in place on section titles and product names, these naturally indicate to a search engine that this text holds more indication about page content, so if you did go plural on those areas, both the internal and external searches would be better i feel.

            Comment


              #7
              The coding change would be quite easy. You just need to look at the end of the word and change the ending.

              The rules are complicated though. There are some better rules than just deleting an 's'. See: http://jonjohnston.co.uk/published/P...o_singular.php

              'ss' => false,
              'os' => 'o',
              'ies' => 'y',
              'xes' => 'x',
              'oes' => 'o',
              'ies' => 'y',
              'ves' => 'f',
              's' => ''
              Some of these are wrong though. 'ves' such as 'Knives' should become 'knife' so replace with 'fe', not 'f' as stated. But this would also change 'hives' into 'hife' which is wrong, Maybe the case of 'the exception which proves the rule'. Also not sure why he has 'os' as a specific case when it's covered by the final 's'=''.

              There's also then the problem of what to do about singular words that end in s. Canvas, atlas, lens, dress, etc. 'SS' can be left alone, but that's the only easy one.

              If you're doing this I'd probably also change the script so that it searches for both the plural and singular to make sure the search finds both cases. Not neessary if you just do the simple version of removing the last s.

              Mike
              -----------------------------------------

              First Tackle - Fly Fishing and Game Angling

              -----------------------------------------

              Comment


                #8
                Did anybody think of looking in the KB?
                Paul
                Flower-Stands.co.uk - the UK's largest online supplier of Fresh Flower Merchandising Stands

                Using V10.2 with Norman's brilliantly simple TABBER.

                Comment


                  #9
                  That will do it too. But for some reason it replaces apples with appl which is a step too far.

                  Also you'll have to re-do that Perl patch if you update Actinic to a new point version. My tweak will survive upgrades.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                    #10
                    Did anybody think of looking in the KB?


                    So much for the OPs search. This is also discussed in the forum.

                    Alan's post here http://community.actinic.com/showthread.php?t=41320 adds some of the other options.

                    Mike
                    -----------------------------------------

                    First Tackle - Fly Fishing and Game Angling

                    -----------------------------------------

                    Comment


                      #11
                      Originally posted by olderscot View Post
                      That thread contains an error, as post #1 is c&p'd from a KB article that was initially erroneous.

                      The KB was subsequently corrected.

                      The file to edit is 'search.pm' and NOT 'searchscript.pl'
                      Paul
                      Flower-Stands.co.uk - the UK's largest online supplier of Fresh Flower Merchandising Stands

                      Using V10.2 with Norman's brilliantly simple TABBER.

                      Comment

                      Working...
                      X