In a lot of queries, linkit times out and does not return anything, in others, it just takes forever.
Love the idea of using this module, but it is not practical for medium to large amounts of content. (30k+ nodes)

If we could better limit the number of nodes returned maybe it would be more scalable.

CommentFileSizeAuthor
#7 1954734--linkit-scale-7.patch448 bytesdrupalninja99
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anon’s picture

Category: bug » feature

I agree.

Tho there is a problem we have to solve if the limitation is implemented.

The problem is how should we determine which results that will be emphasized?

westwesterson’s picture

Doesn't the order of the results already do this? most people are not going to scroll through a list of 100s or thousands of results. They will keep typing till the list is a reasonable length. See google's search suggest feature.

If a person wants to literally look at each possible link, then a different interface would probably be needed which is suitable for the purpose of sorting through 100s to 1000s of possible links, etc.

It is not clear if this additional interface would be out of scope of the base module, but I feel that the additional interface would be a separate request. I don't know if most users would need this capability.

With 30k+ nodes linkit autocomplete, is more of a url suggestion engine, than a listing of every node on the site.

silkogelman’s picture

A thought on this: maybe (optional) Search API module integration can help. It allows search to be configured. As requirements vary from case to case, configurability sounds essential.

silkogelman’s picture

Issue summary: View changes

needed to correct mistake with original post

drupalninja99’s picture

Issue summary: View changes

+1

drupalninja99’s picture

Search API integration would be great. Also 1 work-around might be finding ways to limit the data set. I am going to look at the queries being called. The more characters you require to be keyed in, the less results you will get back.

drupalninja99’s picture

One thing that is an easy fix is the suggestion from #2, we just need to limit the results. I think 10 is an easy number. We could add a settings page for this number, but for now I think 10 would be a good default to go with. The big issue is that entity_load is getting called on every result, so we can't have 100's of results pulled and not have the thing bust.

drupalninja99’s picture

FileSize
448 bytes

Here is a patch that limits the results to 10. We could alternatively have a setting on the linkit profile that sets the limit of the results.

anon’s picture

You can alter the query using tag hooks.

JayDarnell’s picture

Great module you all! Anon can you expand on your last comment? I'd be interested in learning more about how I can alter the query LinkIt uses to find results. The module is amazing and I'm creating different profiles for different types of content to help trim down results in advance. I would however like a way to take events and exclude events scheduled for dates in the past from the results or a way to take news items and only return news from the last year or so.

Any general guidance - even if its just pointing me at some API pages would be great. I've done some custom module dev but I often struggle with knowing where to start.

Cheers!

anon’s picture

JayDarnell’s picture

Thanks anon

JeroenT’s picture

Thanks anon, this worked for me.

<?php
/**
 * Implements hook_query_TAG_alter().
 *
 * Limit the number of linkit results.
 *
 * @param $query
 */
function mymodule_query_linkit_entity_autocomplete_alter(&$query) {
  $query->range(0, 10);
}
?>
anon’s picture

Status: Active » Closed (works as designed)

Use the alter method.