Hello,

I cannot get partial word matching for the Views Filter "Search Terms" to work.

For example:
Content 1: Cats go meow meow.
Search: Cat
Result: Nothing

Is it possible to make it so the result is Content 1?

Thank you.

Comments

dawehner’s picture

Well views just uses internally the search.module and search.module doesn't support searching in strings, but they use searching in words.

If you want people to just search in the node body you could use content: body as filter and use contains as operator, though this might be slower as the search.module query.

rawrzors’s picture

Thanks,

This might be out of the scope of this issue, but do you have any idea how to resize the box created by your method?

dawehner’s picture

Status: Active » Fixed

Css is the key.

Marking the issue as fixed.

Status: Fixed » Closed (fixed)

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

rooby’s picture

Just for reference, for anyone who needs this and doesn't mind running a couple of hacked modules.

This requires:
* A hack to the drupal core search module - See the patch at #498752-19: Partial word search for Drupal 7
* A hack to views - see the patch in this post. - This patch supports search filter and argument but you can use one without the other if desired.

liquidcms’s picture

#1 - won't work too well as Body is now a field and doesn't contain the full node (with other fields)

but there is a Combine Fields Filter which also lets you pick "contains" as an operator. this lets you chose which Fields to search in.

rooby’s picture

There is also the http://drupal.org/project/computed_field module, which lets you make a fields of all the fields you want to search on and then you can filter by that field.

ditcheva’s picture

Issue summary: View changes

Hi folks,

So does this mean that the patch in #5 will not be applied? I'm also interested in partial word searching on the 'Search Terms' filter.

Have folks found other ways of doing that? I'm wondering why this issue has been closed...

ditcheva’s picture

Status: Closed (fixed) » Active
rooby’s picture

Yes, this won't be committed, because it requires a patch to drupal core in [#6001310-19] to work.

Because that drupal core patch is a change in functionality it won't get into drupal 7, but if you want to make an issue to fix it in drupal 8 (if there isn't already one) maybe drupal 8 could address this.

ditcheva’s picture

Status: Active » Closed (won't fix)

Oh, ok. Thanks for responding! I may just go the Computed field filter value with a 'Contains' operand then...