I am here to share about Drupal's Search Module limitations & solution to overcome it.
Limitation:- Drupal's Search Module provides search results on the basis of exact keyword match. i.e. when we search a word like 'what' in our website, it give results only where the word 'what' exactly matches & it doesn't include words like 'whatever' in search results. It concludes that Search module executes search query with a EQUAL(=) condition in WHERE clause but we always require results from a search query with a LIKE condition in WHERE clause.
Solution:- We need to create our own custom Search module with same features exactly the Drupal's Search module but with LIKE condition based search query. As we have created a custom search module for reference, you can use & modify it according to your requirement.
You all are free to ask/share anything regarding this.
Project Link:- http://drupal.org/sandbox/annkit87/1597860
Git Repository Link:- http://drupalcode.org/sandbox/annkit87/1597860.git
Version Compatibility:- Drupal 7
Review of other projects:-
http://drupal.org/node/1771086#comment-6436734
http://drupal.org/node/1773848#comment-6556674
http://drupal.org/node/1736430#comment-6437586
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | search_custom.zip | 2.8 KB | developers_rtpl |
| search_custom.zip | 3.59 KB | developers_rtpl |
Comments
Comment #1
developers_rtpl commentedComment #2
developers_rtpl commentedRevised Custom Search module.
Comment #2.0
developers_rtpl commentedWe have reviewed other projects.
Comment #3
developers_rtpl commentedAdded tag: PAReviews: review bonus as outlined on http://drupal.org/node/1410826
Comment #4
developers_rtpl commentedComment #5
jvdurme commentedHi there,
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
There are still a lot of code standard errors. Please fix them first, you can see them here: http://ventral.org/pareview/httpgitdrupalorgsandboxannkit871597860git
Also change the git repository link to
git clone http://git.drupal.org/sandbox/annkit87/1597860.git developer_custom_searchManual review:
line 61: use t('Search Results')
cu,
Joost
Comment #6
dharam1987 commentedHello,
Your project has many errors listed under the Drupal Code Sniffer, as mentioned by jvdurme, here is the link
http://ventral.org/pareview/httpgitdrupalorgsandboxannkit871597860git
Manual Review
1- The queries which you have written are correct but are not secure, please check here for further instructions http://drupal.org/writing-secure-code
2- For all anchor tags do not use direct markup use l() instead, http://api.drupal.org/api/drupal/includes%21common.inc/function/l/7
3- use arg() function of drupal instead of exploding the query string, reference - http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/arg/7
Thanks
Comment #7
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
Comment #7.0
klausiAdd one more link under Review of other projects