Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1954734--linkit-scale-7.patch | 448 bytes | drupalninja99 |
Comments
Comment #1
anonI 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?
Comment #2
westwesterson CreditAttribution: westwesterson commentedDoesn'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.
Comment #3
silkogelman CreditAttribution: silkogelman commentedA 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.
Comment #3.0
silkogelman CreditAttribution: silkogelman commentedneeded to correct mistake with original post
Comment #4
drupalninja99 CreditAttribution: drupalninja99 commented+1
Comment #5
drupalninja99 CreditAttribution: drupalninja99 commentedSearch 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.
Comment #6
drupalninja99 CreditAttribution: drupalninja99 commentedOne 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.
Comment #7
drupalninja99 CreditAttribution: drupalninja99 commentedHere 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.
Comment #8
anonYou can alter the query using tag hooks.
Comment #9
JayDarnellGreat 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!
Comment #10
anonhttps://api.drupal.org/api/drupal/modules%21system%21system.api.php/func...
http://cgit.drupalcode.org/linkit/tree/plugins/linkit_search/entity.clas... Line 216
Comment #11
JayDarnellThanks anon
Comment #12
JeroenTThanks anon, this worked for me.
Comment #13
anonUse the alter method.