System configuration:
Drupal 6, Ubercart 2, CCK and Finder (from Feb 2010)
When using Finder Views for finding nodes(products) containg some text in fields defined via CCK modules, I get only one result where should be more results.
Quick fix workaround is to set the number of results to a big number like 100 and the it displays more items in search results.
I tried to find out with Devel module what's going on with DB queries when searching and found, that there is no SQL distinct selection in some SQL queries and it returns the node several times in the temporary results serving as an input to other queries.
I would like to debug more and then send a patch, that will fix the issue. I would like to help and actively participate. I will try to bring the fix on this issue by the end of April.
Comments
Comment #1
danielb commentedCan you explain what you mean by "set the number of results to a big number like 100"
If you are talking about a views setting, then that setting should be unlimited.
I am afraid that optimizing the queries satisfactorily will not be possible until Views 3.
Comment #2
kobetic commented"set the number of results to a big number like 100" is meant as MyFinder -> Advanced settings -> Pager set to "100" from "10".
If the pager is set to 10, I get only one item found on search results page, if I set it to 100 I get 8 items (which is correct) on search result page.
In my uninitiated opinion, the problem is that in SQL queries are some JOINs clauses that select the first item multiple times(in more returned rows). Lets say that the query returns the first item in first 10 rows. Than the pager is applied for the first ten rows - which is basically only one item. I would say that the initial query should have some
DISTINCTin selecting node IDs. That's my very first insight.Comment #3
kobetic commentedMore on investigation...
I tried to find the root cause of the problem and the root cause is in finder_views/includes/finder_views_plugin_display_finder.inc in function query, where in comment is written:
// Add group by's for choices - this is actually screwed thanks to
// views_handler_field.inc adding the base field in add_additional_fields().
That causes that the query which is selecting nodes cannot be grouped and returns one node in multiple rows, which leads to incorrect behaviour...
Comment #4
danielb commentedAh yes I'm aware of that. I think it will be easily fixable when Views 3 comes out, other than that I'm not really sure how to fix it. :( Possibly when I finish implementing intersected queries for elements. I'm not entirely clear on that though.
Comment #5
danielb commentedre: views3 issue #624120: Redesign choices uniqueness and duplicates
also, depending on your finder, the newly added solution to this may help you as well #698754: multiple keywords wont return any results
also pager related issues: #733446: Pagination issues
Comment #6
ShadowMonster commentedI have also similar problem. I investigate that problem is with CCK field text area (rows). If I choose this content to search It give me only one result when normally I have many else. So for now i have been not include this fields. I use View Finder type of-course. Used view give me correct results.
So it's look like problem is with text area of CCK field.
Comment #7
emcniece commentedHaving a similar problem! Views pager disabled, Finder pager enabled. I'm searching a view of 12 CCK fields, with a mixture of text and dropdowns. Thought I'd throw in some data for consideration:
Case 1: Pager set to '0', displays all results. Finder outputs 35 results
Case 2: Pager set to '1'. Finder outputs 1 result per page (cool) over 255 pages.. that's 255 results? Why didn't we see that in Case 1?
Case 3: Pager set to '2'. Finder displays: 1 result/page except for page 4,7,32,35,38,42... for a total of 128 pages.
Case 4: Pager set to '3'. Finder displays: 1 result/page up to page 7, where it starts to display 2 results/page every odd page (7, 9, 11, 13, 15.. etc) for a total of 85 pages.
Case 5: Pager set to '4'. Finder displays: 1 result/page except for random pages with 2 results/page, total of 64 pages
Case 6: Pager set to '10'. Finder displays: 2 results/page, randomly 3 results/page, total of 26 pages
Case 7: Pager set to '100'. Finder displays: page 1: 16 results. Page 2: 14 results. Page 3: 7 results.
Strange patterns indeed...