I've read through the issues here and find other related questions, but nothing that resolves my problem.

I unzipped the porter-stemmer module as instructed in the INSTALL.txt file. It is in the default modules directory (same location as other 3rd party modules).

I went to 'Administer > Site building > Modules', and enabled the Porter Stemmer module.

Then I went to 'Administer > Site configuration > Search settings' and clicked 'Re-index site'.

Then I manually ran cron numerous times until it reported that 93% of the site is indexed (it won't seem to go beyond that no matter how many more times I run cron)

Then I tested it. It doesn't do anything. I tried it with numerous words of different lengths. Each time it returns only the *exact* spelling.

I am running Drupal 6.13.
PHP Version 5.2.6-3ubuntu4.2
Ubuntu 8.04.
Apache/2.2.11
MySQL 5.0.75

Any suggestions will be greatly appreciated. Maybe some known issue with these other apps or platforms?

Comments

jhodgdon’s picture

Try this:

a) Create some content with the word "walking" in it. Save the content. Run cron a few times.
b) Try a search for "walking" and verify that your new content comes up in the search results.
c) Try a search for "walk" and verify that your new content comes up in the search results.

Note: You might not see the word "walking" highlighted in the excerpt shown in the search results, but you should see the content page come up in the search results list. See this issue for details:
#437084: Excerpt fails to find stemmed keyword

Please report back on how this test worked. If it worked, then Porter Stemmer is working.

dacroz’s picture

Thanks for the prompt response.

The "walk" / "walking" test works. But I guess I don't understand how the stemmer works. In the same post, for example, I included the words "porter" and "stemmer".

A search for the word "stemmer" finds it correctly, but a search for "stem" does not.

A search for the word "porter" finds it, but no other variations -- such as "port", "porte", "por", etc. find it.

[edited later to add: I also discover that a search for the term "walking" returns a number of other posts, but none of them actually have the entire word "walking" in them. They just have "walk".]

jhodgdon’s picture

The Porter Stemmer algorithm is meant to stem English words to their roots, so that any two words with the same word should match (e.g. walk, walking, walked, and walks should all match).

It isn't a perfect algorithm, so I am not sure if it matches all English words to their roots.

It also doesn't do random substring matching, but only matching that is based on English linguistics. So you should never find it matching "walking" with "alk" or "wal".

Does that help?

You might look for the "n-gram" Drupal module, which may do more what you are looking for.

jhodgdon’s picture

Status: Active » Fixed

I have added some notes to the main Porter Stemmer project page to explain better (I hope) how the module behaves... Hopefully this resolves your support issue? Feel free to change the status back to "Active" and post another question if you still need help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.