Hello,

i am totally desperate. I have a very simple task in mind and am totally lost on how to get it done.

I noticed that the exposed view filter does search with the '=' operator in the search index. I have 2 entries, 'betriebstischler' and 'tischlerhandwerk'. When i enter 'tischler' as a search phrase i get no results.

I have looked over the issue queue but no find on if this is implemented or how to get there. Is it SO hard to make it search with the 'like' operator?

I hope someone could get me up to date here.

Thank you

Comments

merlinofchaos’s picture

Status: Active » Fixed

Without knowing what filter you're using, I can only suggest changing the operator to 'Contains'.

merlinofchaos’s picture

Is it SO hard to make it search with the 'like' operator?

Is it SO hard to file proper requests that actually include enough information to give you a reasonable answer?

Is it SO hard to treat the people you're asking to help you with a little more respect than you're showing?

l0calh0rst’s picture

It's a simple search for keywords. Don't know it's name in english. In the filter's administration i don't see the option to change an operator. I can see those operator options in other filters like 'node type' though.

l0calh0rst’s picture

Is there no way to achieve this?

The filter's name is 'keys' (i assume). It is part of the group 'search' when i choose a filter to add. There are only 3 filters in that group.

As opposed to other text filters (e.g. node title) this filter does not provide an option to change the operator.

l0calh0rst’s picture

Helpless as I am, i only found this: http://drupal.org/node/103548

This is a core hack to implement the search for "search_index.word like '%mykeyword%'" instead of "search_index.word = 'mykeyword'".

THIS is what i meant by "Is it SO hard...". Really, I am clueless. Is it?

This is no disrespect. Since the other string fields DO support the 'contains' operator, why not the common search filter?

Status: Fixed » Closed (fixed)

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

Bobuido’s picture

I ran into a similar issue as the OP

TBF it was more a poor choice in the way I stored data but I too would love to see the "contains" operator make it's way into other types of fields / filters.

My issue was I was using a multi-select profile field ("selection" type with Profile Checkboxes module) which would then mash together the options into one field making it difficult to filter

This meant when filtering the options, with two filters, they would never match in any multiple selections

e.g.
Option1 Car
Option 2 Lorry
Option 3 Bike

None of these would match, say, a record that had "Lorry, Bike"

The "contains" operator would have been my saviour here but was not an option. I appreciate that not including it on all fields may have a very good reason behind it but I guess myself and the OP would have appreciated it to get out of our particular predicaments.

barber75’s picture

Hey Bobuido,

I am having the exact same problem as you are having, and it's driving me insane! I need to sort it out quite ASAP as well for a project i have to finish in the next week!

What did you do about this? Did you find a solution to it? I have looked at endless forum threads, tried reading into exposed filters as well, but haven't found a concrete solution.

Did you have to create a new view filter handler or something? You can't alter the form element in a form_alter either in the exposed form block, total nightmare!

Let me know what ya did dude, you could save my bacon

cheers
Craig

Bobuido’s picture

You will not like my solution. I rebuilt it from the ground up. Ditching the original profile field and using http://drupal.org/project/user_terms (with http://drupal.org/project/betterselect) in it's place. Unfortunately I don't think any of this will help you as I doubt you had _exactly_ the same scenario as me. I bypassed the need for partial matching, in this instance, by using terms - Which are handled separately and not "mashed together"

You might want to see if this helps for your particular situation
http://www.examiner.com/open-source-in-national/drupal-how-to-create-vie...

Can't say I've actually looked that closely at it but it was one of the links I stumbled across when looking at my options. How much insight it gives you into your problem... IDK... I'll try to follow up this in case you want a bit more info from my specific situation

Doubt any of this helps but hope it does

csimmons44’s picture

Old thread, but since it comes up in Google and has a lot of noise, first answer is correct, change the operator to 'contains'.