1

Now apachesolr search works only in content. It also have to work on other fields for eg: on typing "test", It searches only in content.

My requirement is to search on description,label also (which i have already indexed). content:abcd OR description:sample_upload_document Using apachesolr.api.php,I tried hook_apachesolr_query_prepare($query)

function MYMODULE_apachesolr_query_prepare(DrupalSolrQueryInterface $query) {

     $query->addParam('qf','content description');
     watchdog('solr result',print_r($query,true));

}

refering to the sitehttp://knackforge.com/blog/selvam/drupal-7-filtering-solr-results.
After performing that, i found description is added to

SolrBaseQuery Object
    (
        [params:protected] => Array
            (
                 [qf] => Array
                    (
                        [0] => content^40
                        [1] => description
                    )

But still when i give the value for description, search results would not yield any value.

Am i correct in a way? why doesnt it return the result?

How to do that? default search,searches the given text only in content.How to make it to search on other fields like description,label?

1

You could use Search Api Module

This module provides a framework for easily creating searches on any entity known to Drupal, using any kind of search engine. For site administrators, it is a great alternative to other search solutions, since it already incorporates facetting support and the ability to use the Views module for displaying search results, filters, etc. Also, with the Apache Solr integration, a high-performance search engine is available for this module.

Using It you could create index for the field you choose!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.