Hello, It was a long time that I was waiting Views integration with Faceted Search, thanks!
But I never used faceted serach before and I've got some question about views integration:
1) Views integration uses arguments? So users should enter exactly the argument in order to make the view page result work?
2) The base path (/admin/settings/faceted_search) must be the same than the page path? (what I do)
Is my view settings are enough? see the screenshot
3) Right now, when I use the keywork block, the result page is the defaut page, not the view page, but when I click on "more option" I have the view page. Normal?
Thanks :)
| Comment | File | Size | Author |
|---|---|---|---|
| #39 | Views3Support-372187-38.patch | 1.74 KB | mrP |
| #38 | Views3Support-372187-38.patch | 1.74 KB | mrP |
| screenshot_search_results.JPG | 35.69 KB | Junro |
Comments
Comment #1
Junro commentedComment #2
David Lesieur commented1) Have you read the documentation? There is a section about Views integration.
2) Faceted Search Views will embed your view's default display. The page display and its path are irrelevant.
3) Uncheck the Use the Extracts display style selectively option in your faceted search environment.
Comment #3
Junro commentedsure I had read he documentation ^^
ok, Use the Extracts display style selectively option was check.
Now I have this:
warning: preg_match() expects parameter 2 to be string, array given in /home/pariscin/www/includes/bootstrap.inc on line 737.
recoverable fatal error: Object of class faceted_search could not be converted to string in /home/pariscin/www/sites/all/modules/views/includes/view.inc on line 682.
Comment #4
Junro commentedI updated the Views 6.x-2.3, and I still got this:
warning: preg_match() expects parameter 2 to be string, array given in /home/pariscin/www/includes/bootstrap.inc on line 737.
recoverable fatal error: Object of class faceted_search could not be converted to string in /home/pariscin/www/sites/all/modules/views/includes/view.inc on line 688.
Comment #5
David Lesieur commentedTry removing the argument from your view. It probably interferes with Faceted Search Views' own argument manipulation (which will probably need to be made more robust!).
Try also applying the patch in #371398: Bug in module causes exception. if you have not applied it yet (but I guess you have already).
Comment #6
Junro commentedIf I remove the argument from the view, I don't have the warning error, but the search doesn't work: no results.
Your search yielded no results
Check if your spelling is correct.
Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.
Consider loosening your query with OR: blue smurf will match less than blue OR smurf.
The search works great with the core search module.
ps: I'm using the patch "faceted_search_views_arg.patch"
Comment #7
matt2000 commentedI'm having the same or a similar issue. My views display:
recoverable fatal error: Object of class faceted_search could not be converted to string in /home/web/sites/all/modules/views/includes/view.inc on line 1024.
and my integer CCK facets yield no results, even those the count shows that there are nodes.
Comment #8
matt2000 commentedOk, my second symptom is definitely specific to CCK facets, so not relevant to this queue. I'm not sure baout the first symptom yet, though. It is the same error as Junro. Any insight?
Comment #9
Junro commentedI've still got this problem... I don't know how to resolve that... :(
Comment #10
David Lesieur commented@Junro: Still got the problem with version 6.x-1.0-beta2?
Comment #11
Junro commentedYes, exactly the same problem, no changes.
Comment #12
Junro commentedoh just have some news...
I disable Autocomplete Node Finder module and I have this:
warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /home/pariscin/www/includes/database.mysql.inc on line 321.
warning: preg_match() expects parameter 2 to be string, array given in /home/pariscin/www/includes/bootstrap.inc on line 737.
--->/home/pariscin/www/includes/bootstrap.inc on line 737.
same message that:
warning: preg_match() expects parameter 2 to be string, array given in /home/pariscin/www/includes/bootstrap.inc on line 737.
recoverable fatal error: Object of class faceted_search could not be converted to string in /home/pariscin/www/sites/all/modules/views/includes/view.inc on line 682.
Maybe it would help...
Comment #13
akhil commentedI am trying to use views for displaying the results as described in documentation. After selecting the view for display style, I get no results for all keywords.
Your search yielded no results
Check if your spelling is correct.
Remove quotes around phrases to match each word individually: "blue smurf" will match less than blue smurf.
Consider loosening your query with OR: blue smurf will match less than blue OR smurf.
It works fine with Teasers and Extracts. I echoed the $search variable in format_results function of faceted_search_views.module and it has 1 result but views_embed_view doesn't return any result. I have a simple node-view with pager on. Am I doing some mistake in configuring the view?
Comment #14
akhil commentedPutting these two lines (taken from teaser style class) before returning in format_results function of faceted_search_views.module
$limit = $this->get_limit();
$found_items = $search->load_results($limit);
seems to show the results correctly. I don't know if this is correct (using faceted search for the first time), but might help.
Comment #15
ccshannon commentedHaving same problem. View is setup according to documentation, unchecked Extract, now I get "no results" message.
Going to try some other Views settings.
Comment #16
ccshannon commentedI did the following, and then I got results.
Not only should you not expose filters, you should just remove them entirely. Also remove any sorting. Also set a limit per page, even though the docs say you can use Unlimited (it will use the Drupal results per page settings) I put in a limit (the same one as the system, why not).
Now I get the view display. So, I think some Views tweaking will do the trick.
Comment #17
David Lesieur commented@ccshannon: I have reproduced one of the issues you have mentioned: When a view had an unlimited number of items per page, we got empty results instead of the documented behavior of using the system's default number of nodes per page. I have just committed a fix for this bug.
However, using non-exposed filters and sort handlers should work fine. Views integration would not be so useful without those.
Comment #18
ccshannon commentedThank you for investigating the issue, David. I did the "change three things at once" method, got results, and hadn't yet spent the time to figure out exactly which one it was. Much obliged. Cheers!
Comment #19
macrodesign commenteddear ccshannon,
your 3 step is so logical and workable, but i failed. i tried the following additional steps although, created a new search environment, created a new view tried other combination etc but No results when I use a view in results. my only problem is that I want to hide the statistics on the search page i.e. "Medium - admin - 06/24/2009 - 00:24 - 0 comments - 0 attachments" that's it. If there is another simpler way of doing it, please advise so I don't bother my self (4rth time so far) trying to combine views with faceted search (beautiful monster).
Comment #20
ccshannon commented@macrodesign
Hey! Sorry I was off Drupal.org for a few days. Just saw this but have to shut down for tonight.
I am going to look at this tomorrow, just want to keep the ball in play, so to speak. Talk to you, soon! -C
Comment #21
macrodesign commentedthanks ccshannon,
i will be looking forward to hearing from you.
best wishes
Danish
Comment #22
bramface commentedNote typo on line 1114 of view.inc - "apger" instead of "pager".
Although fixing that did NOT solve my "Object of class faceted_search could not be converted to string" error....
-Bram
Comment #23
ccshannon commentedSorry about the delay, macrodesign. Got busy, have bad back from sitting wrong, etc. Haven't been myself lately.
In any case ... if you just want to theme your existing search results, and if you feel comfortable with a little PHP, you can copy the file modules/search/search-result.tpl.php, into your site theme folder. The $info variable contains the stats you want to make invisible. If you want to keep some of those stats, you can get to them via the $info_split variable. The documentation is in the head of the template file.
As far as faceted search, make sure you have a node view, that it has no arguments and no exposed filters, that it has a pager, and that the items per page is set to a number other than 0. Go back into faceted search settings and try selecting the view again. Save your settings.
The site I'm working on ended up taking the template approach. Originally the client wanted to break up the results in the display by content type, but they finally realized they wanted all the content in the same search results on the page, so I did not get to go further with working with faceted search, at least on this project.
Best of luck!
Comment #24
macrodesign commentedthanks ccshannon, i will try this and let you know.
Comment #25
v8powerage commentedI made faceted search views results based on default frontpage view (just got rid of "featured on the front page", and "sticky" filters), but when I click on vocabulary and navigate to some page (I'm using ajax pager and that was the cause of using the views at the first place) in results I'm getting all nodes from all vocabularies instead of just the chosen one.
Comment #26
tallsimon commentedthis is a fantastic feature, using it to put sticky/promoted nodes first, no problems with this (i'm using beta version). thanks!
Comment #27
joelbox-mondial-it commentedWhen using faceted search 6.x-1.x-dev and setting results page to output a view, a sql error is thrown: must have 1 column ...
Inspecting the query it shows that the end of the query is fetching more then a node id from the database.
Only a view with 1 item (the nid) is working with faceted search, adding even one extra field to the view starts throwing the sql error. (note sort,filter, etc are not set).
To resolve i re-installed the module, set the permission in the sql database (on temp and creation), created a fresh empty view, and read all the posts i could find.
But all to no avail, any help would be greatly appreciated as I think this is one of the best modules making Drupal shine!
Code with a view where nid and title are used as fields.
Operand should contain 1 column(s) query: CREATE TEMPORARY TABLE temp_faceted_search_results_1 (nid int unsigned NOT NULL, PRIMARY KEY (nid)) Engine=HEAP SELECT n.nid AS nid, 5 * POW(2, (GREATEST(MAX(n.created), MAX(n.changed), MAX(c.last_comment_timestamp)) - 1269938595) * 6.43e-8) + 5 * (2.0 - 2.0 / (1.0 + MAX(c.comment_count) * 1)) AS score FROM node AS n LEFT JOIN node_comment_statistics AS c ON n.nid = c.nid WHERE ((n.status = 1) AND (n.type IN ('advert_type_01'))) AND n.nid IN (SELECT DISTINCT(node.nid) AS nid, node.title AS node_title FROM node node WHERE (node.status <> 0 OR (node.uid = 1 AND 1 <> 0) OR 1 = 1) AND (node.type in ('advert_type_01')) GROUP BY nid ) GROUP BY n.nid ASC ORDER BY score DESCComment #28
joelbox-mondial-it commentedI have been digging some more. The problem seems to come from the view itself. Disabling piece by piece is seems the "ajax" and the select "distinct" settings should be off solved the issue.
That closes the issue on the faceted search que, for me. Perhaps someone else running into the error, will find it, so i'll leave the post.
kr. Joel
Comment #29
arievdonk commentedWell the problem still exist when selecting more than one field.
Anyone a solution?
Comment #30
reniren commented@Joel Box: I am still experiencing the error "operand should contain 1 column". The Views I am using for Faceted Search already have all of the things mentioned disabled (ajax, distinct, no exposed filter, no sorting).
Any idea what else I should try??
....
Before I got "here", I was stuck figuring out why the Views I created did not show up on Display Style dropdown in the Faceted Search config (though they already conform to the requirements: node, default, enabled). The solution I found: I exported them and integrated the code in faceted_search_views.module in the implementation of hook_views_default_views(), with all the above mentioned param explicitly disabled. Still, once I modified these Views, they disappear again from the Display Style dropdown. Does anyone else experience this problem?
Thanks!
Comment #31
stockliasteroid commented+1 with disabling "Distinct". I had the same error, and when I disabled distinct it immediately went away.
Comment #32
mchelenError appeared with upgrade to Views 6.x-3.0-alpha3. Trying faceted_search 6.x-1.x-dev 2010-Jul-11 and Views 6.x-3.x-dev 2010-Aug-13 didn't help.
Comment #33
milos.kroulik commented+1 Same for me
Comment #34
Aldus commenteddid someone work this out?
Comment #35
whitelancer commentedI found another bug that you could try fixing to see if it works for you.
In regards to the dev branch as of 2010-Jul-11, and using views 3.x (dev)
In the faceted_search_views.module, in the function query_alter:
Move the subquery call inside the if statement, and add a 'count' to ensure args were provided:
You also need to modify references to pagers: views 3 has different pagers.
In faceted_search_views_faceted_search_ui_style_info():
Change:
to:
I also commented out the use of pagers in the faceted_search_views_views_pre_execute() call:
Before:
After:
HTH someone.
Comment #36
redaccion commentedDisabling select "distinct" settings was enough...
Comment #37
Anonymous (not verified) commentedSolution #35 is perfect ! Thank you very much
Comment #38
mrP commentedbundled #35 as a patch.
Comment #39
mrP commentedtestbot please. any chance this can get rolled into a new DEV version?