I am trying to create a user search which should be an exposed filter with one field.
User: ___________ [Search]
I need this textfield input to search Username (system) / First Name (cck field) / Last Name (cck field).
I do not see how I can use ViewsOr to expose the ViewsOr alternatives as one field?
Gary
Comments
Comment #1
tinsmon commentedI have the same situation, I have two exposed filters that I want to be searched using one form field. I've installed the Views Or module and tried several different filter combinations:
Views Or: Begin alternatives =
Content: Field 1 exposed
Content: Field 2 exposed
Views Or: End alternatives =
This would, in theory, use the "COALESCE" function, but any time I have both filters exposed I get all kinds of "invalid argument" errors on the view preview and when I search using the exposed Field 1 form it only gives me the matching results from Field 1, no results from Field 2. Also, this means I still have two form fields on the view page since both filters are still exposed.
If I change it to this:
Views Or: Begin alternatives =
Content: Field 1 exposed
Content: Field 2 contains
Views Or: End alternatives =
Which means the second filter is not exposed, I get no preview errors and only one form on the view page, but a search only yields results from Field 1, not both.
I've also tried this:
Views Or: Begin alternatives =
Content: Field 1 exposed
Views Or: Next alternative =
Content: Field 2 exposed
Views Or: End alternatives =
Again, this gives me tons of "invalid arguments" errors and two exposed form fields and entering a search term in the field 1 form still only shows results from field 1, not both.
So, I change it to this:
Views Or: Begin alternatives =
Content: Field 1 exposed
Views Or: Next alternative =
Content: Field 2 contains
Views Or: End alternatives =
Which means Field 2 is no longer exposed. This gets rid of all errors and gets me back to only one form on the view page. But now the filtering doesn't work at all. I enter a search term in the one exposed form field and get all records returned, including those that do not contain the search term.
What am I missing???
Comment #2
tinsmon commentedAnybody there?
Comment #3
marcrobinsone commentedI've tried View OR just now for exposed filters.
It does seem to work. Just make sure that you have "Next Alternative" into the mix.
While it will work, there is a duplication of results.
Comment #4
spacereactor commentedit possible only show 1 input box for all 3 expose filters with View OR?
Comment #5
ygerasimov commentedUser search task can be done using other module: Computed Field. You can create Computed field that will just add (sum) all the names together and save them in database so they can be searched with views.
Comment #6
JThan commentedRaed this comment: http://drupal.org/node/451000#comment-2800416
Comment #7
jelo commentedSubscribe
Comment #8
technikh commentedhttp://drupal.org/node/451000#comment-2800416 works like a charm!!
Nice detailed explanation..
Comment #9
jnettikMy understanding is that that module you create in in http://drupal.org/node/451000#comment-2800416 will always search all the fields you add to it.
Would it be possible to add a dropdown next to the text field that allows a user to pick which field they want to search in?
Comment #10
darren ohDuplicate of #396094: exposed filters generate error.
Comment #11
darren oh