Once you add a CCK field then the CCK will not by default get indexed. You have to delete all the existing index and have to re-index all items. This is because, CCK fields are properties of all the documents (nodes) that goes to the SOLR index.
Once all the items are index then you can find those by sis_cck_field_* names where sis_* is a type of dynamic field provided by SOLR itself. You can find the CCK index status in admin/reports/apachesolr/index
page or in SOLR admin (http://127.0.0.1:8983/solr/admin/schema.jsp)
page.
EDIT -- 1
As mentioned, the field is indexed properly then try to search by the value of the CCK field in Apache Solr's admin search (http://localhost:8983/solr/admin/form.jsp
). If you see the search results appear as per your desire then there may be a permission issue. If your field is called "field_example" then in permission page check whether "view field_example" is checked for desired roles.
Edit -- 2
In that case I think the cck field is not at all being indexed. I had the same problem once with CCk fields that stores "multiple" values. In that case what I had to do is to create a new field in SOLR index and index the item again. This may solve your problem but may not be a proper way. However you will find this way is excepted in Drupal also in this link.
You have 2 ways to achieve this.
- Append the item in the body field in time of content indexing hook.
- Add a new dynamic field to the document object while indexing and fetch the field while searching.
For the 1st one,
function MYMODULE_apachesolr_update_index(&$document, $node, $namespace) {
$document->body .= ' '. $node->field_MY_CCK_FIELD[0]['view'];
}
For the 2nd one,
function MYMODULE_apachesolr_update_index(&$document, $node, $namespace) {
// For multiple values.
foreach ($array as $value) {
$document->setMultiValue('sm_multiple_value', $value);
}
// For text field.
$document->addField('ts_element_name', $value);
}
And while searching,
function MYMODULE_apachesolr_modify_query(&$query, &$params, $caller) {
$params['fl'] .= ',ts_element_name'; //Add the field name to the select query.
}