2011-08-18 39 views
1

這是我們在一年前開始看到的一個奇怪的錯誤。起初,我只是偶爾在我的開發機器上注意到它,但現在它已經開始出現在生產中,這是有問題的。SolrNet小寫查詢字符串上的Solr字段名稱導致Solr 1.4失敗

我們在生產中使用Ubuntu(11.04)和Mono 2.6.7(我也可以用Mono 2.10.x重新生成),使用mod_mono在apache中。

基本上,有時(非常難以重現),當apache啓動應用程序時,SolrNet決定小寫整個傳送到solr服務器的URL。如果應用程序處於這種狀態,它將保持這種狀態,直到它重新啓動(偶爾需要重新啓動幾次才能清除)。我們可能會進行20-50次或更多的重新啓動,而不會出現此問題。有時會發生每2或3

一個很好的URL看起來是這樣的:

INFO: [] webapp=/solr path=/select params={sort=Creative.PromotionalScore+desc&start=0&q=*:*&?=&qt=standard&fq={!tag%3DCreative.GalleryReviewStatus}Creative.GalleryReviewStatus:Approved&fq={!tag%3DCreative.SectionIncludedTarget}Creative.SectionIncludedTarget:220358+OR+(NOT+Creative.SectionIncludedTarget:[*+TO+*]+*:*)&fq={!tag%3DActive}Active:true&fq={!tag%3DCreative.ShowInGallery}Creative.ShowInGallery:true&fq={!tag%3DCreative.Size}Creative.Size:"Rectangle"&fq={!tag%3DRecordType}RecordType:FiveToOne.Gallery.Rmx.Creative&rows=12} 

無效的URL看起來是這樣的:

http://solrServer:8080/solr/select?qt=standard&fq=%7b!tag%3dcreative.galleryreviewstatus%7dcreative.galleryreviewstatus%3aapproved&fq=%7b!tag%3dcreative.sectionincludedtarget%7dcreative.sectionincludedtarget%3a306433+or+(not+creative.sectionincludedtarget%3a%5b*+to+*%5d+*%3a*)&fq=%7b!tag%3dactive%7dactive%3atrue&fq=%7b!tag%3dcreative.showingallery%7dcreative.showingallery%3atrue&fq=%7b!tag%3dcreative.size%7dcreative.size%3a%22rectangle%22&fq=%7b!tag%3drecordtype%7drecordtype%3afivetoone.gallery.rmx.creative&sort=creative.promotionalscore+desc&rows=18&start=0&q=*%3a*&? 

(第一,我很抱歉,這兩個URL是從管道的不同階段提取的,目前我只能訪問)

當提交錯誤的URL時,Solr會拋出一個致命異常,抱怨未知字段:

HTTP Status 400 - can not sort on undefined field: creative.promotionalscore 

type Status report 

message can not sort on undefined field: creative.promotionalscore 

description The request sent by the client was syntactically incorrect (can not sort on undefined field: creative.promotionalscore). 

回答

0

曾使用Solr的和SolrNet生產四年了,所有我能說的是,我從來沒有見過這樣的.NET,所以我猜它在單聲道的錯誤。

爲了準確找出URL正在變成小寫字母的位置,我放了幾個記錄點,例如here,herehere

在這個日誌記錄到位後,一旦發生錯誤,日誌應該被分析,日誌應該可能被改進等,直到找到錯誤的確切來源。

希望那麼錯誤可以被複制,報告,固定等

+0

多謝毛,我打算在今天堅持這些,我會讓你知道,如果這有助於! – Bennidhamma

+0

@Bennidhamma:有關這方面的消息嗎? –