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,
When I try to configure the default "More like this" block it seems like a field is missing :
Fields for finding related content *
There is no way of actually choosing the fields, which of course causes a validation error when I try to submit the form :
Fields for finding related content field is required.
The weird thing is, the More Like This block seems to be working just fine anyways, just the configuration that doesn't.
Comment | File | Size | Author |
---|---|---|---|
#14 | 1965210-14.patch | 1.05 KB | pwolanin |
#6 | drupal-solr.report.png | 21.53 KB | soulfroys |
#6 | apache-solr-log.png | 18.23 KB | soulfroys |
#6 | solr-search-index.png | 5.94 KB | soulfroys |
#4 | no_fields.png | 40.86 KB | Growiel |
Comments
Comment #1
soulfroysSame here (6.x-3.x-dev) :-(
Comment #2
Nick_vhSeems to be working fine for me? Can you try with latest dev? Did you index your content already?
Comment #3
pwolanin CreditAttribution: pwolanin commentedcan't reproduce this - can you add a screen shot?
Note that the list of fields comes form the index.
Comment #4
Growiel CreditAttribution: Growiel commentedMy content in indeed indexed. I just re-indexed it with the latest dev (to fix issue #1957070: "Solr search index will be rebuilt." message appears at the top of every view. (Even when index has been completely rebuilt.)) :
Here's a screenshot from the "More Like This" block configuration page :
As you can see, I can't select any fields.
And finally, when I submit the form, I have the following error, as expected :
Comment #5
pwolanin CreditAttribution: pwolanin commentedRight, so you are not getting the field list from the index . This admin page actually makes a request to Solr if the result is not in the cache.
Check you logs for error messages.
Comment #6
soulfroysMy reports...
I'm using Solr 4.2.1 (Jetty) in all my tests:
Test 1: Drupal 7.21 + apachesolr 1.x-dev (last)
Test 2: Drupal 6.26 + apachesolr 6.x-3.x-dev (last, with this patch from #1550964: Support Solr 4.0 schema)
- 1 error in Solr log, but related to "i18n" (image).
- In both cases, no errors in Drupal log and I had the same result as @Growiel.
Comment #7
Growiel CreditAttribution: Growiel commentedI don't have anything in the logs, neither in Apache logs, Drupal reports or Solr logs.
However, I went ahead and searched the cause of the problem and located it :
The faulty part is the $field->schema{4}.
I var_dumped my fields and V only appears in 5th position :
string(7) "content" string(16) "ITS--V----------"
string(5) "label" string(16) "ITS--V--O-------"
string(10) "path_alias" string(16) "ITS--V--O-------"
string(14) "taxonomy_names" string(16) "IT--MV--O-------"
string(15) "tm_vid_10_names" string(16) "ITS-MV----------"
and so on.
This also explains why there's nothing in the logs : Solr does return something, it's the php part that ends up returning an empty array.
I don't know Solr well enough, but might this be due to the way Solr 4.x works as opposed to 3.x / 1.4 ?
Is this due to my own implementation (since I'm not the only one having the problem, I doubt it) ?
Hope that helps !
Comment #8
Growiel CreditAttribution: Growiel commentedComment #9
Growiel CreditAttribution: Growiel commentedAny update on this ? Do you want me to submit a patch changing 4 to 5 ?
Comment #10
justluvgod CreditAttribution: justluvgod commentedI was experiencing the same issue.
configuration:
- Drupal 7.21
- Apache SOLR integration - 7.x-1.2
- SOLR 3.6.2
I made the change you suggested (changing 4 to 5) and now the field boxes appear. Thanks for your help.
For anyone who wants to implement this update, the document of reference is apachesolr_search.module located in the apachesolr module.
Comment #11
Nick_vhSo this is a difference between solr 3 and 4? We should use the getSolrVersion function to see how we react on the different outputs
Comment #12
Growiel CreditAttribution: Growiel commentedDoesn't looks like it since I use Solr4 and justluvgod is using Solr3.
Comment #13
Greg Varga CreditAttribution: Greg Varga commentedI can confirm that changing
if ($field->schema{4} == 'V') {
to
if ($field->schema{5} == 'V') {
in apachesolr_search_mlt_get_fields() does work for Solr 4. (Module: 7.x-1.2)
I agree, Solr version has to be checked in this function.
Comment #14
pwolanin CreditAttribution: pwolanin commentedIt would seem the position is not significant, just the letter?
Solr 3.6.2 has this key, which indicates each letter is unique:
Comment #15
jrreid CreditAttribution: jrreid commentedPatch in #14 works for me (Solr 4.3.0)
Comment #16
pwolanin CreditAttribution: pwolanin commentedfixed in 7 and 6.x-3.x
may need to be ported to 6.x-1.x
Comment #17
stephenplatz CreditAttribution: stephenplatz commentedSame issue, using 7.x-1.3 and Solr 4.3.1. Patch #14 works.
Comment #18
Khalilou CreditAttribution: Khalilou commentedSame issue, using 7.x-1.3 and Solr 4.3.1. Patch #14 works.
Comment #19
pwolanin CreditAttribution: pwolanin commentedThis is in the latest release - please upgrade.
Comment #20
venky123 CreditAttribution: venky123 commentedI am using upgraded version of drupal and solr-4.4.0
But the problem still persists in windows system.
Its("FIELDS FOR FINDING RELATED CONTENT") working fine in Linux system.