Honestly this is a really great module.. I'm just having a few issues since the documentation isn't entirely that clear.. if you could help me that would be super awesome!

I'm having two major problems with this module that I can't figure out.

1. What is the proper format for returning values in your callback....

Is it $fields[] = array('value' => 'your value here'); or something else?

2. It's not really clear to me how to access these fields after they have been indexed? Specifically if I output the result set that comes back I don't see any of the CCK fields that have been indexed. I saw you posted a suggestion before with regards to accessing the node from node_load but if it's being indexed with data I'd rather just grab that instead?

3. Do I need to actually add these fields to my solr configuration? That part is also not clear...

Comments

robbin.zhao’s picture

Status: Active » Fixed

1. it is the value of this indexed field value,
such as, here is a field you created, 'is_test', means int/single, so it should be a int value
if multi values, just return array, like array(11,2,3)

2. the solr will return the document object, so the data is the field of the document field value, such as $document->is_test

3. no need to change solr config, it support generic value already.

i am not sure if it is clear, hope it is helpful.

Thanks,
-Robbin

shaneonabike’s picture

Component: Documentation » Code
Status: Fixed » Needs work

Actually what I discovered is that I could never get this working until I implemented the hook for apachesolr_modify_query. I think that normally adding these fields to this means that they are indexed properly. Just wondering if the module should include this hook and add these variables??

function mymod_apachesolr_modify_query(&$query, &$params, $caller) {
  $fl = explode(",", $params['fl']);
  $fl[] = 'ss_cck_field_file_image';
  $fl[] = 'ss_cck_field_file_media';
  $fl[] = 'ss_cck_field_file_other';
  $fl[] = 'ss_cck_field_file_file';
  $params['fl'] = implode(',', $fl);
}
robbin.zhao’s picture

Status: Needs work » Postponed

Your fields are file/image/media ?
Oh, I don't think I consider these fields.

I will check your question later.
Thanks!

Anonymous’s picture

Hello.
I see that I should attach fields manualy while making a query, should not I?
Thank you.

robbin.zhao’s picture

yes, if you want to use custom fields, add a query in SOLR search keys, it will work.