Is there any way to perform a partial word search in Drupal.
I have been looking around all the drupal site and I haven't found a way to do this.
I really need this to get my site going.
I need the ability to perform a search of part of a word (drup) and get the nodes that contain the word (drupal) that marches the partial word (drup).

Comments

anulaibar’s picture

... that feature.

erika’s picture

yes you can do that
Go to Administer >> Site Configuration >> search settings

good luck

anulaibar’s picture

Thanks Erika, but I don't understand how. I looked in Administer > Site configuration > Search settings, but the only setting that comes close is the "Minimum word length to index". This still does not allow me to do partial word search so when I search for "welcom" the search still won't return hits for "welcome". Any further help greatly appreciated...

erika’s picture

Yes Olle...
sorry for the late response...
I also did the same kind of search as you told...Now I also need help...I typed "welco" but the search result didint hit for "welcome"...
any help would be appreciated...
If you are successful pl post how did you achieve it...

cation555’s picture

Hi,

I'd appreciate some clarification on this issue.

I want to search small strings and parts of words, so I set 'Minimum word length to be indexed; to 1.
However, if I search for part of an IP address in a content type (e.g. type in 127) I get no results. I must type in the entire IP address (e.g. 127.0.0.1) in order to get a search result.

Thanks in advance,

minute’s picture

Hell,

Also, I want to ask if is any way or module to enable the search partial keyword. I Have a database of telephone numbers and I want to search witch one begins with ... 000 for example... and the search return nothing! Please help us!

WorldFallz’s picture

http://drupal.org/search/node/partial+search

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

davehci’s picture

Huh? no results found. Any answers to this? Seems pretty important

baxpace’s picture

I'm having a hard time not flaming out on this commnet.  Just don't hit submit next time you feel that superiority complex coming on

umesh.joshi@trinitywebtech.com’s picture

Please User "Fuzzy Search" module
Link : http://drupal.org/project/fuzzysearch

Debbie Hulbert’s picture

I am desperately in need of a partial word search option for Drupal 7. I am not code savvy. Installed the dev version of fuzzy search - BAD IDEA. It broke the site. Had to uninstall and do a rollback to previously backed-up version.

Any idea when a stable fuzzy search or other partial word search module will be ready? Any coders out there who want to build one?

rooby’s picture

For a drupal 7 version of this see - #498752-19: Partial word search for Drupal 7
And for support for the search filter and argument in views also see #1480594-5: Filter Search Terms partial matching

knalstaaf’s picture

Actually there's a quick way to set this up with the Search API and the Search API Database Search modules. No need for Solr.

  1. Enable both the modules and go to the Search API configuration page
    (admin/config/search/search_api)
  2. Add a server and give it a recognizable name (such as "MySQL"), make sure it's enabled
  3. Choose the following service class: Database service (normally the only option. If you don't see it, make sure that the "Search API Database Search" module is enabled).
  4. Selecting this service class will provide you the option Search on parts of a word (make sure you enable it). Now hit "Create server".
  5. Next, go back to the Search API configuration page, and add an index. Again give it a recognizable name, such as "Contentindex", and make sure it's enabled.
  6. Select the server you recently created (in this example "MySQL"). Datasource options: check the content types you want to index (the description of this field may be a bit confusing, but make no mistake: you should check the content types you want to index, not the ones you want to leave out).
  7. You could check "Index items immediately", but that depends on the size of your content. This option is alright for smaller websites. In the other case: let cron take care of it. Hit "Create index".
  8. Next, you want to enable the fields (in the fields tab) to that very index, e.g.: content type, title, status and author - and hit "Save changes" (we'll take care of the related fields later).
  9. Then you want to configure the filters (in the filter tab). Here you can enable the bundle filter, if you want to finetune the content types once again (probably won't need to).
  10. Down below you'll find the highlight filter, to highlight the search word in the results.
  11. Now return to the fields tab and unfold the "Add related fields" tab. Add all the fields of which you want to get the content indexed, and hit Save.
  12. Finally go to the "view" tab of the index, and index now all the items.

The last step is to create search results page and search block in Views, which only takes a few minutes.

  1. Make sure the submodule Search Views is enabled and create a view page which will show "Contentindex" (select the name you gave to your index configuration instead of "content" which is selected by default.
  2. Add all the fields (make sure your format is "fields") that every search result should consist of (title [link to content], body, …).
    You'll notice that these fields look like this Indexed Node: Title
  3. Add an exposed filter: Search: Fulltext search; and select the following in its settings: Contains any of these words, and use as: Search keys.

You're done!

There's an excellent video tutorial on this partial search method without Solr, which also incorporates faceted search (which is not necessary for partial search, but in case you're interested…). If you're only looking for a partial search option, you can watch the video until 5:08 and after that skip to 6:45.

carbonomedia’s picture

knalstaaf thank you for this..... nice clear instructions and works a treat. One thing I can't figure out is how to get the highlight filter to work in the 'The main body text » Text' that was added in the Related fields section. It works no worries in the Title fields, but the Strong tags are just not being added to the body field in the view. any ideas? am i missing something? or is it just not possible?

thanks again!

knalstaaf’s picture

I couldn't make the highlighting work either, it's probably only supported for solr.

carbonomedia’s picture

Okay... no worries.... glad its not just me.... I can live with this. thanks again.

knalstaaf’s picture

There's probably a jQuery workaround for this (which compares the value of the search field with its appearance in the results).

maxplus’s picture

@knalstaaf

Thanks, nice tutorial!

raginit’s picture

This solved my issue. Thanks for clear instructions