I have incorporated the DS Search into an architecture website I'm working and it's wonderful. I'm grouping by content type (using the fieldset option).

http://dev.thehopkinscompany.com/

For search queries that don't produce too many results, everything works as expected. For example, if you type in "Heebe", you can see that the content which contains the word "Heebe" is arranged and sorted to match the order I've set in the Display Suite settings (Screenshot attached below. The order is "Projects", "Firm", "Basic Page", "Webform", "Article", "License", "Homepage Banner".

Issue: If you type in a search query that has a bunch of results, the ordering of the results seems sporadic. For example, type in "New Orleans". You'll see that the first content to appear is "Article", and the articles continue for a few pages even though they are relatively far down in the ranking (see screenshot). Then on Page 4 you'll see one "Project". On Page 9 you'll see two "Projects". On Page 10 you'll see five "Projects", three "Articles", and two "Homepage Banners". On Page 11 you'll see four "Projects", five "Articles", and one "Homepage Banner". On Page 12 (final page), you'll see two "Projects" and eight "Articles".

Similary if you type in Covington, which renders three pages of results (10 items per page), the results are scattered.

I couldn't identify a pattern. Any idea of what might be causing this?

Awesome module. Thanks so much for your work on all of this swentel.

CommentFileSizeAuthor
ds_search_order.PNG19.11 KBwoop_light
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

woop_light’s picture

Note that as I've been adding content and such, some of the specific results have changed from what I posted yesterday. However, the principal issue remains.

swentel’s picture

Category: bug » support

I don't think it's a bug (as far as I can see), the actual order of results returned by apache solr by default is by score. So all results are first returned by score (solr) and then per page bundled (ds). that's why it might seem scattered.

woop_light’s picture

Thanks for the quick reply. Unfortunately I cannot use Apache Solr because of my web host (http://support.godaddy.com/groups/web-hosting/forum/topic/apache-solr-an...).

If I'm using Node search rather than Apache solr, I assume the same applies? (i.e., My search result ranks the content, then DS groups the content within each page result). I'm trying to figure out ways to fix it, but from what you're saying it seems like more of a Core Search issue than a DS issue. I tried this hook without any luck (http://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/...)

function hopkinscompany_ranking() {
  return array(
    'node_type_boost_search' => array(
      'title' => t('Node type boost search'),
      'arguments' => array(':node_type_boost' => 'project'),
      'score' => ' FIND_IN_SET(n.type, :node_type_boost)',
    ),
  );
}

Where 'hopkinscompany' is my theme and 'project' is my content type.

swentel’s picture

The same probably applies indeed, but haven't really checked to be honest with core search, I always reserve one day of DS hacking at drupalcons, I'll see if I can reproduce this.

aspilicious’s picture

Status: Active » Postponed (maintainer needs more info)

I don't use the search integration myself, so I wonder if this is still an issue. Will leave this open for a few more weeks.

mikemoretti’s picture

I think this is similar to the bug I found https://www.drupal.org/node/2380501 where weight is totally ignored.

It appears I was only able to fix it for one page of results. As I now realize that weight should be used over the entire search query not just each page, so in my case, I have say the "Class" content type as first in the weights, and so on every results page, that type of content shows up first. Where it should just show all "Class" content for multiple pages until there aren't any more and then show the next weighted type. I too am just using the built-in drupal search (not SOLR). This is a huge disappointment. The only reason I use this module at all is to get the weighting. I.e. for a school, we want classes we sell to show up first in the results followed by other stuff.

aspilicious’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

DS search in't the best search module. The "search api" module is way better and it has way better weighting support.
And there is a "search api database" backend. So you don't need solr.

I must admit that the configuration will be harder than the DS search module but you'll love it in the end.

There is a reason we are removing the search support for D8.

crutch’s picture

Thanks #6 patch fixes the issue.