Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have been struggling the whole day to understand how to make the values of my CCK fields to work properly with this. I have two languages, English and Greek and from what i understand, by looking at the schema.xml all dynamic fields (which are used for the cck support) use the "text" solr field type which is for English only.
Is it possible to make these dynamic fields to be language aware ? does this functionality already exists and i simply missing it?
Looking forward to a reply
Comment | File | Size | Author |
---|---|---|---|
#10 | 1288144_2.patch | 2.59 KB | mkalkbrenner |
#9 | Screenshot.png | 28.86 KB | arekanderu |
#1 | 1288144.patch | 2.4 KB | mkalkbrenner |
Comments
Comment #1
mkalkbrennerThat's not true. In your schema.xml you should find a dynamic field called ts_el_* for greek using text_el.
But I recognized that we missed to create the language specific equivalent for multiple values: tm_LANGUAGE_*.
Please try the attached patch. And don't forget to configure your search fields to use the language specific dynamic fields after you indexed some content.
Comment #2
arekanderu CreditAttribution: arekanderu commentedIndeed there is a ts_el_* in my schema.xml but if i go to admin/settings/apachesolr/query-fields the language specific ts fields do not exists. For example I only see ts_cck_field_reservations: but no "Greek ts_cck_field_reservations" as i see for body
Comment #3
mkalkbrennerJust to be sure:
You see ts_cck_field_reservations at admin/settings/apachesolr/query-fields but not ts_el_cck_field_reservations, right?
Comment #4
arekanderu CreditAttribution: arekanderu commentedExactly. Also, i would expect ss_ fields to have language support inside the schema but they dont. Why is that?
I can give you admin access if you want
Comment #5
arekanderu CreditAttribution: arekanderu commentedI can see in schema browser that the field is there but it has no terms in it.
Comment #6
mkalkbrennerss means "string single". Strings are not handled in a language specific way like the type text. They're stored as they are. So this is correct.
The problem seems to be during indexing in these lines of code in apachesolr_multilingual.module:
It would be interesting to see the values of $language when $field_name is 'ts_cck_field_reservations'. Are you able to debug this?
Comment #7
arekanderu CreditAttribution: arekanderu commentedYeah i am able to debug.
It seems that $fields = $solr->getFields(); on line 135 always returns empty and the foreach loop is never executed. Any logic reason why?
Comment #8
mkalkbrennerIn my setup $solr->getFields() returns the fields in the index.
But as I'm thinking of it, it seems to be a race condition. If your index is empty, getFields() returns an empty result. If you re-index twice without deleting the index, it should work.
Could please verify that?
Comment #9
arekanderu CreditAttribution: arekanderu commentedDidn't work unfortunately. I do see a lot of what you see on the screenshot I have attached you. Is this normal?
Comment #10
mkalkbrennerPlease test this patch in combination with the patch from #1.
Comment #11
arekanderu CreditAttribution: arekanderu commentedI applied both patches, re-indexed but problem persists. Is there something I can do in order to help you figure this out quicker?
Comment #12
mkalkbrennerOK, we have to figure it out step by step.
I think we already solved two small issues:
1. tm_LANGUAGE_* has not been indexed in general
2. a race condition when indexing the first nodes
I already committed both patches to git branch 6.x-2.x. I suggest you directly work with this git branch instead of patching your code.
Now we to figure out why your ts_* fields are not getting copied to ts_LANGUAGE_*.
Are you sure that even with the latest code from git $fields (see #6) is still empty?
BTW which version of apachesolr modul did you install?
Comment #13
arekanderu CreditAttribution: arekanderu commentedI removed everything, downloaded the git version (http://drupal.org/node/828026) and re-indexed everything and I can now see the tm_el_* fields in Search Fields but still no ts_el_* fields yet...
I am using apachesolr 6.x-2.x-dev
Comment #14
mkalkbrenner