Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
exposed filters
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2010 at 21:03 UTC
Updated:
22 Feb 2011 at 23:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
klaus66 commentedsearch_parse_query() is no longer in drupal 7.
I see the class SearchQuery in drupal 7 has this functionallity.
Therefore I think the search filter is not ready yet for drupal 7.
Comment #2
dawehnerYou still have the issue assigned to yourself ;)
Comment #3
klaus66 commentedThanks.
But how can I change this.
I can edit my comment but not the issue itself.
Can you help me.
Comment #4
dawehnerThat's not as easy to solve as you think. Currently you can comment out this line but
SearchQuery uses form_set_error('keys') which will fail on exposed filters for some cases
=> we have to extend this class?
Alternatve we copy the function from d6 and uses it here.
Comment #5
klaus66 commentedYes I think so too.
But I hope you find a solution for this problem, because the search filter is in my eyes a very important filter.
Comment #6
dawehnerYou know there are no many bugs around it's hard to fix every of them at the same time :)
For the most people it's freetime in the issue queue
Comment #7
klaus66 commentedYes i understand that there is many work to do and that I must wait.
I must also say that the most things I need at the moment work well except only the
search filter and the click-sorting fields.
Comment #8
oeduardosegura commentedAny news?
Comment #9
dawehnerThis issue would be marked as fixed if there would be any news.
Comment #10
dawehnerJust some updates.
Now query has to be converted.
Comment #11
bojanz commentedSetting appropriate status.
Comment #12
iamjon commentedi think this needs review no?
Comment #13
dawehnerNo it doesn't work at all yet.
Comment #14
iamjon commentedmy bad resetting the status
Comment #15
mfbsubscribe
Comment #16
vaartio commentedsubscribe
Comment #17
duellj commentedsubscribing
Comment #18
duellj commentedHere's a patch that expands on the patch from #10. I was able to get basic search working with exposed search filters (basically single/multiple search terms). Type searching does not work and neither does OR and Negative operators. There's still a lot to be done; I had to comment out a lot of the code to get it to run and the code is riddled with todo's.
I actually ran into a couple of very odd problems:
This conditional gets rewritten somewhere to: search_index.types (notice the "s" at the end). Bizzare.
This having clause get's rewritten to: COUNT >= :db_placeholder. The "(*)" is stripped off of the clause.
Hopefully this will be a start towards getting search filters in views working.
Comment #19
dawehnerI general i think it's bad that views has a big part of the search.module in it, just to support it.
There is a alternative approach to this.
* Create a object of searchQuery and execute it's helper functions.
* Get the results back by extending searchQuery and use some getter's.
This would allow a much smaller code change than currently.
Comment #20
robash commentedSubscribing
Comment #21
ngmaloney commented@dereine I'm currently looking into the feasibility of rolling a patch based on your comment #19. Could this be achieved by replacing the call to search_parse_query() with an instance of SearchQuery and the parseSearchExpression() function? I'm not able to locate any other modules that use SearchQuery object to uses as reference.
Comment #22
dawehnerThat's the problem when working on views. There are often no other modules fighting with this kind of problems :(
Already worked many hours on this problems without any success.
Comment #23
duellj commentedThe price to pay to be on the forefront of technology :).
dereine, thank you for work on this! Can you post up what you've got so far? (This is where the git issue sandboxes would come in very handy)
Comment #24
dawehnerAs i said i managed to do nothing, at least nothing which can't be achieved in some seconds.
See #19
Comment #25
dawehnerFound something from my backup.
Never said that this is something useful
Comment #26
duellj commentedThanks dereine! I'll see what I can do with this patch (@ngmaloney if you want to try too, be my guest).
Comment #27
ngmaloney commentedThanks @dereine and @duellj. I'll post any progress I'm able to make. I think the #25 patch provides some good next steps to look into. The searchQuery() is so heavily abstracted I wasn't sure how to create a useful object instance that views could use.
Comment #28
jonaswouters commentedsubscribing
Comment #29
aschiwi commentedApplied patch from #25, new error message is
This message shows up after hitting submit on an exposed form for all filters (which work without this patch), even if search is left empty.
Comment #30
aschiwi commentedI have some budget to get this fixed, is anyone interested? How much would we need to raise?
Comment #31
dawehnerThis will perhaps be fixed during the dev days in bruessel because
a) there are people which want to hack
b) there are people which understand search.module/dbtng (berdir)
Comment #32
dawehnerWhat was needed for this patch
* A full package of cookies
* no fear against this issue.
So here is a patch. It works for me on the preview and in the interface fine.
Both with simple ("searchword") and complicated queries("searchword -butnot).
Just a single quote why there are things which complicates the whole thing.
Comment #33
aschiwi commentedHow cool is that! :) This works for me for simple searchwords, but not for the "searchword -butnot". The error for the latter is:
Comment #34
dawehnerOkay hacked core to see the variables better :(
Comment #35
aschiwi commentedAwesome, now it works as intended!
Comment #36
aschiwi commentedLet's get it in then :)
Comment #37
dawehnerThanks for the testing.
Commited to the 7.x branch.
Comment #38
mfbThanks for getting this in.
One problem I found, there is a fatal error for complex search queries, which you can see if you give it a query that mixes AND (or just multiple words, as the AND is implied) with OR: Recoverable fatal error: Method DatabaseCondition::__toString() must return a string value in views_handler_filter_search->query() (line 141 of /views/modules/search/views_handler_filter_search.inc).
Comment #39
dawehnerThere are places where dbtng really stands out and makes things easy.
Here is a new version.
Comment #40
jrs69 commentedSorry, probably a simple question here... first time running a patch..... what directory should i place these patches and after I run the patch command on the command line, which file should we be patching?
ty
Comment #41
dawehnerSee http://drupal.org/patch/apply
The directory is the views module..
Comment #42
mfbThe patch at #39 seems to fix complex queries for me, thanks.
One other thing though... what about the search argument handler, views_handler_argument_search.inc? That will need to make use of viewsSearchQuery class as well.
Comment #43
dawehner@mfb
Thanks for testing the patch.
Commited to 7.x branch.
Would it be okay to create a new issue for this? Would be cool.
This is not that hard to fix, because we already figured out this problem here.
Comment #44
mfbok, #1055602: Fatal error in search argument