Does anyone have any suggestions for removing the file extension from the search index ?

Here is the issue :
- have a content type with attachments enabled (using the core upload module)
- add a new node for this content type and attach a pdf file for example
- when attaching the file, we leave the default description as is, which is the filename, including the .pdf file extension
- if the filename was example.pdf , when this node is indexed, the word examplepdf is added to the search_index and search_dataset tables
- so searching for example does not find anything, but searching for examplepdf does

Changing the description works, but I'm hoping to have it work using the defaults, since this is how most of our users upload files. I also tried this with the latest Drupal 7 beta with the same results.

Thanks

Comments

jhodgdon’s picture

Status: Active » Fixed

You can use the search API to make a module that strips off file extensions during search indexing.

See http://api.drupal.org/api/function/hook_search_preprocess/6

Status: Fixed » Closed (fixed)

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