5 Replies Latest reply on Feb 8, 2008 3:16 AM by Günter Schenk

    Multiple keywords

    Level 1
      Hi,

      I have added a search option to a website. When i search to a topic with 1 keyword the topic is found, when i add a second keyword the topic is not found anymore. Both keywords are mentioned in the topic.

      For example :

      Text in topic -> I like chocolate.
      When i search for 'chocolate' -> Topic found.
      When i search for 'like chocolate' -> Topic not found.

      I already changed 'equals' to 'begins with' and other parameters but this didn't change anything.

      How can i solve this?

      Many thanks,
      Daniel
        • 1. Re: Multiple keywords
          Günter Schenk Level 4
          Hi Daniel

          did you try with "contains" ?

          Cheers,
          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Multiple keywords
            Level 1
            Hi Günther,

            Yes, i have... Currently i have this query :

            SELECT *
            FROM berichten
            WHERE artikel LIKE %colname%
            ORDER BY datum DESC

            The result is like i mentioned above. Any other solution?

            Many thanks,
            Daniel
            • 3. Re: Multiple keywords
              Günter Schenk Level 4
              Hi Daniel,

              I really don´t understand why LIKE %colname% doesn´t work here - it usually should capture your search term combinations just fine.

              BTW, are you doing a FULLTEXT search, where the term "like" is considered a stopword by MySQL ? Though I doubt this would make a difference, as stopwords are just getting ignored...

              Cheers,
              Günter Schenk
              Adobe Community Expert, Dreamweaver
              • 4. Re: Multiple keywords
                Level 1
                Günther,

                I've done some more 'research' and it seems i'm only having problems with a search string which contains the character '&'.

                For example :

                Text in topic : Günther & Dreamweaver
                If i search for 'Günther & Dreamweaver' topic is not found.

                Maybe you should also know that fckeditor is used to insert the text.

                Could it be the character '&'?

                Thanks & regards,
                Daniel
                • 5. Re: Multiple keywords
                  Günter Schenk Level 4
                  Daniel,

                  ------
                  Could it be the character '&'?
                  ------

                  I think so, also because FCKEditor by default saves such special characters as html entities, means "&" will be converted to "&" plus "amp;", which of course is not something a regular human being would ever search for.

                  If that is important to you, I´d rather suggest replacing such html entities with e.g. the literal term "and" -- although MySQL will also skip this one when doing a FULLTEXT search, as "and" is one of the ignored stopwords.

                  Cheers,
                  Günter Schenk
                  Adobe Community Expert, Dreamweaver