Hello,
I have a content type with A LOT of CCK fields and as a result the produced query string is the following:
fl=id%2Cnid%2Ctitle%2Ccomment_count%2Ctype%2Ccreated%2Cchanged%2Cscore%2Cpath%2Curl%2Cuid%2Cname%2Cis_upload_count%2Cts_cck_field_gallery_image%2Cts_cck_field_image_cache%2Cts_cck_field_listing_type%2Cts_cck_field_map%2Cts_cck_field_logo%2Cts_cck_field_image_gallery%2Cts_cck_field_slide_header%2Cts_cck_field_price_range%2Cts_cck_field_feature_pool%2Cts_cck_field_feature_gym%2Cts_cck_field_feature_spa%2Cts_cck_field_feature_wifi%2Cts_cck_field_view_type%2Cts_cck_field_accessibility%2Cts_cck_field_meals%2Cts_cck_field_parking%2Cts_cck_field_alcohol%2Cts_cck_field_music%2Cts_cck_field_massage%2Cts_cck_field_safe_box%2Cts_cck_field_24_reception%2Cts_cck_field_airport_shuttle%2Cts_cck_field_hair_salon%2Cts_cck_field_pet_friendly%2Cts_cck_field_smoking%2Cts_cck_field_meeting_room%2Cts_cck_field_slogan%2Cts_cck_field_conference_facilities%2Cts_cck_field_website%2Cts_cck_field_laundry_facilities%2Cts_cck_field_stars%2Cts_cck_field_has_online_booking%2Cts_cck_field_online_booking_url%2Cts_cck_field_affiliate_url%2Cts_cck_field_add_video&rows=10&facet=true&facet.mincount=1&facet.sort=true&hl.fl=ts_cck_field_gallery_image%2Cts_cck_field_image_cache%2Cts_cck_field_listing_type%2Cts_cck_field_map%2Cts_cck_field_logo%2Cts_cck_field_image_gallery%2Cts_cck_field_slide_header%2Cts_cck_field_price_range%2Cts_cck_field_feature_pool%2Cts_cck_field_feature_gym%2Cts_cck_field_feature_spa%2Cts_cck_field_feature_wifi%2Cts_cck_field_view_type%2Cts_cck_field_accessibility%2Cts_cck_field_meals%2Cts_cck_field_parking%2Cts_cck_field_alcohol%2Cts_cck_field_music%2Cts_cck_field_massage%2Cts_cck_field_safe_box%2Cts_cck_field_24_reception%2Cts_cck_field_airport_shuttle%2Cts_cck_field_hair_salon%2Cts_cck_field_pet_friendly%2Cts_cck_field_smoking%2Cts_cck_field_meeting_room%2Cts_cck_field_slogan%2Cts_cck_field_conference_facilities%2Cts_cck_field_website%2Cts_cck_field_laundry_facilities%2Cts_cck_field_stars%2Cts_cck_field_has_online_booking%2Cts_cck_field_online_booking_url%2Cts_cck_field_affiliate_url%2Cts_cck_field_add_video%2Cbody_el&spellcheck.q=%CE%BE%CE%B5%CE%BD%CE%BF%CE%B4%CE%BF%CF%87%CE%B5%CE%AF%CE%BF&spellcheck=true&facet.field=uid&facet.field=type&facet.field=language&facet.field=language&facet.date=created&facet.date=changed&f.created.facet.date.start=2011-09-23T17%3A04%3A54Z%2FHOUR&f.created.facet.date.end=2011-09-23T17%3A06%3A31Z%2B1HOUR%2FHOUR&f.created.facet.date.gap=%2B1HOUR&f.changed.facet.date.start=2011-09-23T17%3A05%3A56Z%2FHOUR&f.changed.facet.date.end=2011-09-23T18%3A40%3A09Z%2B1HOUR%2FHOUR&f.changed.facet.date.gap=%2B1HOUR&facet.limit=20&qf=name%5E3.0&qf=body_el%5E1.0&qf=title_en%5E5.0&qf=body_en%5E1.0&qf=title_el%5E5.0&qf=ts_cck_field_gallery_image%5E1.0&qf=ts_cck_field_image_cache%5E1.0&qf=ts_cck_field_listing_type%5E1.0&qf=ts_cck_field_map%5E1.0&qf=ts_cck_field_logo%5E1.0&qf=ts_cck_field_image_gallery%5E1.0&qf=ts_cck_field_slide_header%5E1.0&qf=ts_cck_field_price_range%5E1.0&qf=ts_cck_field_feature_pool%5E1.0&qf=ts_cck_field_feature_gym%5E1.0&qf=ts_cck_field_feature_spa%5E1.0&qf=ts_cck_field_feature_wifi%5E1.0&qf=ts_cck_field_view_type%5E1.0&qf=ts_cck_field_accessibility%5E1.0&qf=ts_cck_field_meals%5E1.0&qf=ts_cck_field_parking%5E1.0&qf=ts_cck_field_alcohol%5E1.0&qf=ts_cck_field_music%5E1.0&qf=ts_cck_field_massage%5E1.0&qf=ts_cck_field_safe_box%5E1.0&qf=ts_cck_field_24_reception%5E1.0&qf=ts_cck_field_airport_shuttle%5E1.0&qf=ts_cck_field_hair_salon%5E1.0&qf=ts_cck_field_pet_friendly%5E1.0&qf=ts_cck_field_smoking%5E1.0&qf=ts_cck_field_meeting_room%5E1.0&qf=ts_cck_field_slogan%5E1.0&qf=ts_cck_field_conference_facilities%5E1.0&qf=ts_cck_field_website%5E1.0&qf=ts_cck_field_laundry_facilities%5E1.0&qf=ts_cck_field_stars%5E1.0&qf=ts_cck_field_has_online_booking%5E1.0&qf=ts_cck_field_online_booking_url%5E1.0&qf=ts_cck_field_affiliate_url%5E1.0&qf=ts_cck_field_add_video%5E1.0&qf=body%5E40.0&qf=title%5E5.0&qf=name%5E3.0&qf=taxonomy_names%5E2.0&qf=tags_h1%5E5.0&qf=tags_h2_h3%5E3.0&qf=tags_h4_h5_h6%5E2.0&qf=tags_inline%5E1.0&bf=recip%28rord%28created%29%2C4%2C2%2C2%29%5E200.0&spellcheck.dictionary=spellchecker_el&fq=language%3Ael&start=0&wt=json&json.nl=map&q=%CE%BE%CE%B5%CE%BD%CE%BF%CE%B4%CE%BF%CF%87%CE%B5%CE%AF%CE%BF
By looking at Drupal_Apache_Solr_Service, line 297, i saw that if that the $query_string is more than 4000 characters it's send via POST, If it's less than 4000 it gets send via GET.
My problem is that when the query string is send via POST that the encoding of the value which the 'q' variable contains (the query above is the value returned by http_build_query which so far is correct) gets jibberish and that results into solr return 0 documents. This is what it looks like (taken from catalina.out log) when it gets send with POST
INFO: [] webapp=/solr path=/select params={spellcheck=true&f.changed.facet.date.start=2011-09-23T17:05:56Z/HOUR&facet=true&spellcheck.q=ξενοδοÏείο&facet.limit=20&fl=id,nid,title,comment_count,type,created,changed,score,path,url,uid,name,is_upload_count,ts_cck_field_gallery_image,ts_cck_field_image_cache,ts_cck_field_listing_type,ts_cck_field_map,ts_cck_field_logo,ts_cck_field_image_gallery,ts_cck_field_slide_header,ts_cck_field_price_range,ts_cck_field_feature_gym,ts_cck_field_feature_spa,ts_cck_field_feature_wifi,ts_cck_field_view_type,ts_cck_field_accessibility,ts_cck_field_meals,ts_cck_field_parking,ts_cck_field_alcohol,ts_cck_field_music,ts_cck_field_massage,ts_cck_field_safe_box,ts_cck_field_24_reception,ts_cck_field_airport_shuttle,ts_cck_field_hair_salon,ts_cck_field_pet_friendly,ts_cck_field_smoking,ts_cck_field_meeting_room,ts_cck_field_slogan,ts_cck_field_conference_facilities,ts_cck_field_laundry_facilities,ts_cck_field_stars,ts_cck_field_has_online_booking,ts_cck_field_online_booking_url,ts_cck_field_affiliate_url,ts_cck_field_add_video&f.created.facet.date.start=2011-09-23T17:04:54Z/HOUR&bf=recip(rord(created),4,2,2)^200.0&f.changed.facet.date.gap=%2B1HOUR&facet.field=uid&facet.field=type&facet.field=language&facet.field=language&fq=language:el&facet.mincount=1&facet.date=created&facet.date=changed&qf=name^3.0&qf=body_el^1.0&qf=title_en^5.0&qf=body_en^1.0&qf=title_el^5.0&qf=ts_cck_field_gallery_image^1.0&qf=ts_cck_field_image_cache^1.0&qf=ts_cck_field_listing_type^1.0&qf=ts_cck_field_map^1.0&qf=ts_cck_field_logo^1.0&qf=ts_cck_field_image_gallery^1.0&qf=ts_cck_field_slide_header^1.0&qf=ts_cck_field_price_range^1.0&qf=ts_cck_field_feature_gym^1.0&qf=ts_cck_field_feature_spa^1.0&qf=ts_cck_field_feature_wifi^1.0&qf=ts_cck_field_view_type^1.0&qf=ts_cck_field_accessibility^1.0&qf=ts_cck_field_meals^1.0&qf=ts_cck_field_parking^1.0&qf=ts_cck_field_alcohol^1.0&qf=ts_cck_field_music^1.0&qf=ts_cck_field_massage^1.0&qf=ts_cck_field_safe_box^1.0&qf=ts_cck_field_24_reception^1.0&qf=ts_cck_field_airport_shuttle^1.0&qf=ts_cck_field_hair_salon^1.0&qf=ts_cck_field_pet_friendly^1.0&qf=ts_cck_field_smoking^1.0&qf=ts_cck_field_meeting_room^1.0&qf=ts_cck_field_slogan^1.0&qf=ts_cck_field_conference_facilities^1.0&qf=ts_cck_field_laundry_facilities^1.0&qf=ts_cck_field_stars^1.0&qf=ts_cck_field_has_online_booking^1.0&qf=ts_cck_field_online_booking_url^1.0&qf=ts_cck_field_affiliate_url^1.0&qf=ts_cck_field_add_video^1.0&qf=body^40.0&qf=title^5.0&qf=name^3.0&qf=taxonomy_names^2.0&qf=tags_h1^5.0&qf=tags_h2_h3^3.0&qf=tags_h4_h5_h6^2.0&qf=tags_inline^1.0&json.nl=map&hl.fl=ts_cck_field_gallery_image,ts_cck_field_image_cache,ts_cck_field_listing_type,ts_cck_field_map,ts_cck_field_logo,ts_cck_field_image_gallery,ts_cck_field_slide_header,ts_cck_field_price_range,ts_cck_field_feature_gym,ts_cck_field_feature_spa,ts_cck_field_feature_wifi,ts_cck_field_view_type,ts_cck_field_accessibility,ts_cck_field_meals,ts_cck_field_parking,ts_cck_field_alcohol,ts_cck_field_music,ts_cck_field_massage,ts_cck_field_safe_box,ts_cck_field_24_reception,ts_cck_field_airport_shuttle,ts_cck_field_hair_salon,ts_cck_field_pet_friendly,ts_cck_field_smoking,ts_cck_field_meeting_room,ts_cck_field_slogan,ts_cck_field_conference_facilities,ts_cck_field_laundry_facilities,ts_cck_field_stars,ts_cck_field_has_online_booking,ts_cck_field_online_booking_url,ts_cck_field_affiliate_url,ts_cck_field_add_video,body_el&f.changed.facet.date.end=2011-09-23T18:40:09Z%2B1HOUR/HOUR&wt=json&rows=10&f.created.facet.date.gap=%2B1HOUR&facet.sort=true&start=0&q=ξενοδοÏείο&spellcheck.dictionary=spellchecker_el&f.created.facet.date.end=2011-09-23T17:06:31Z%2B1HOUR/HOUR} hits=0 status=0 QTime=26
As you can see above, the q variable contains jibberish.
If i remove a couple of CCK fields however from my content type, in order to make the produced query_string less than 4000 characters and it gets send via GET, then the produced query (taken again from the catalina.out) has the correct Greek string as you can see below next to the q variable
INFO: [] webapp=/solr path=/select params={spellcheck=true&f.changed.facet.date.start=2011-09-23T17:05:56Z/HOUR&facet=true&spellcheck.q=ξενοδοχείο&facet.limit=20&fl=id,nid,title,comment_count,type,created,changed,score,path,url,uid,name,is_upload_count,ts_cck_field_gallery_image,ts_cck_field_image_cache,ts_cck_field_listing_type,ts_cck_field_map,ts_cck_field_logo,ts_cck_field_image_gallery,ts_cck_field_slide_header,ts_cck_field_price_range,ts_cck_field_feature_pool,ts_cck_field_feature_gym,ts_cck_field_feature_spa,ts_cck_field_feature_wifi,ts_cck_field_accessibility,ts_cck_field_meals,ts_cck_field_parking,ts_cck_field_alcohol,ts_cck_field_massage,ts_cck_field_safe_box,ts_cck_field_24_reception,ts_cck_field_hair_salon,ts_cck_field_pet_friendly,ts_cck_field_smoking,ts_cck_field_meeting_room,ts_cck_field_slogan,ts_cck_field_conference_facilities,ts_cck_field_website,ts_cck_field_laundry_facilities,ts_cck_field_stars,ts_cck_field_has_online_booking,ts_cck_field_online_booking_url,ts_cck_field_affiliate_url,ts_cck_field_add_video&f.created.facet.date.start=2011-09-23T17:04:54Z/HOUR&bf=recip(rord(created),4,2,2)^200.0&f.changed.facet.date.gap=%2B1HOUR&facet.field=uid&facet.field=type&facet.field=language&facet.field=language&fq=language:el&facet.mincount=1&facet.date=created&facet.date=changed&qf=name^3.0&qf=body_el^1.0&qf=title_en^5.0&qf=body_en^1.0&qf=title_el^5.0&qf=ts_cck_field_gallery_image^1.0&qf=ts_cck_field_image_cache^1.0&qf=ts_cck_field_listing_type^1.0&qf=ts_cck_field_map^1.0&qf=ts_cck_field_logo^1.0&qf=ts_cck_field_image_gallery^1.0&qf=ts_cck_field_slide_header^1.0&qf=ts_cck_field_price_range^1.0&qf=ts_cck_field_feature_pool^1.0&qf=ts_cck_field_feature_gym^1.0&qf=ts_cck_field_feature_spa^1.0&qf=ts_cck_field_feature_wifi^1.0&qf=ts_cck_field_accessibility^1.0&qf=ts_cck_field_meals^1.0&qf=ts_cck_field_parking^1.0&qf=ts_cck_field_alcohol^1.0&qf=ts_cck_field_massage^1.0&qf=ts_cck_field_safe_box^1.0&qf=ts_cck_field_24_reception^1.0&qf=ts_cck_field_hair_salon^1.0&qf=ts_cck_field_pet_friendly^1.0&qf=ts_cck_field_smoking^1.0&qf=ts_cck_field_meeting_room^1.0&qf=ts_cck_field_slogan^1.0&qf=ts_cck_field_conference_facilities^1.0&qf=ts_cck_field_website^1.0&qf=ts_cck_field_laundry_facilities^1.0&qf=ts_cck_field_stars^1.0&qf=ts_cck_field_has_online_booking^1.0&qf=ts_cck_field_online_booking_url^1.0&qf=ts_cck_field_affiliate_url^1.0&qf=ts_cck_field_add_video^1.0&qf=body^40.0&qf=title^5.0&qf=name^3.0&qf=taxonomy_names^2.0&qf=tags_h1^5.0&qf=tags_h2_h3^3.0&qf=tags_h4_h5_h6^2.0&qf=tags_inline^1.0&json.nl=map&hl.fl=ts_cck_field_gallery_image,ts_cck_field_image_cache,ts_cck_field_listing_type,ts_cck_field_map,ts_cck_field_logo,ts_cck_field_image_gallery,ts_cck_field_slide_header,ts_cck_field_price_range,ts_cck_field_feature_pool,ts_cck_field_feature_gym,ts_cck_field_feature_spa,ts_cck_field_feature_wifi,ts_cck_field_accessibility,ts_cck_field_meals,ts_cck_field_parking,ts_cck_field_alcohol,ts_cck_field_massage,ts_cck_field_safe_box,ts_cck_field_24_reception,ts_cck_field_hair_salon,ts_cck_field_pet_friendly,ts_cck_field_smoking,ts_cck_field_meeting_room,ts_cck_field_slogan,ts_cck_field_conference_facilities,ts_cck_field_website,ts_cck_field_laundry_facilities,ts_cck_field_stars,ts_cck_field_has_online_booking,ts_cck_field_online_booking_url,ts_cck_field_affiliate_url,ts_cck_field_add_video,body_el&f.changed.facet.date.end=2011-09-23T18:40:09Z%2B1HOUR/HOUR&wt=json&rows=10&f.created.facet.date.gap=%2B1HOUR&facet.sort=true&start=0&q=ξενοδοχείο&spellcheck.dictionary=spellchecker_el&f.created.facet.date.end=2011-09-23T17:06:31Z%2B1HOUR/HOUR} hits=1 status=0 QTime=16
I look at line 305 the following:
return $this->_sendRawPost($this->_searchUrl, $queryString, FALSE, 'application/x-www-form-urlencoded');
Are you sure that content type you use there is correct? Can you please suggest me a solution?
Comments
Comment #1
pwolanin commentedInteresting - possible we need to set an additional header to specify the encoding when doing a POST query, or alter this one?
Try making this change to the content-type string:
Comment #2
pwolanin commentedduplicate to: #901376: utf8 characters can't be searched properly
Comment #3
arekanderu commentedpwolanin, too bad I didn't notice there was a duplicate already and spent plenty time to debug it :)
I applied the change and it seems to work properly now.
Comment #4
pwolanin commentedComment #5.0
(not verified) commentedTypo mistake