Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="http://drupal.org/project/opensearch" rel="nofollow noreferrer">OpenSearch module</a> exposes search results as RSS, no need to code it yourself.</p> <p>If you want a specialised form, you can just to a redirect to the OpenSearch result after processing your form.</p> <p>Addendum: If you really want do do your own, you can use <a href="http://api.drupal.org/api/function/search_data/6" rel="nofollow noreferrer"><code>search_data</code></a> like this:</p> <pre><code>&lt;?php $data = search_data('your searchterms here'); </code></pre> <p>This searches nodes (as the default second parameter for <code>search_data</code>), but can also be used to search users and other things that have implemented hook_search.</p> <p>Also, <code>search_data</code>, belying the name, actually returns the formatted search results. If you want to have the raw search results, you can <a href="http://api.drupal.org/api/function/module_invoke/6" rel="nofollow noreferrer">invoke</a> <a href="http://api.drupal.org/api/function/hook_search/6" rel="nofollow noreferrer"><code>hook_search</code></a> directly, or use <a href="http://api.drupal.org/api/function/do_search/6" rel="nofollow noreferrer"><code>do_search</code></a>. Examples:</p> <pre><code>&lt;?php $results = module_invoke('node', 'search', 'your searchterms here'); $data = do_search($query, 'node'); </code></pre> <p>The difference being is that invoking the hook gives you a lot more node-related data (since it runs through the node-specific search code, in addtion to the generic <code>do_search</code> (node.module's <code>hook_search</code> implementation calls do_search to get the actual work done)) and a possibly more accurate search, since the node search respects the weights you might have set in the search settings. The tradeoff is a slower search query.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload