这是我们大约一年前开始看到的一个奇怪的错误。起初,我只是偶尔在我的开发机器上注意到它,但现在它开始出现在生产中,这是有问题的。
我们在生产环境中使用 Ubuntu (11.04) 和 Mono 2.6.7(我也可以使用 Mono 2.10.x 进行复制),在 apache 内部使用 mod_mono。
基本上,有时(很难重现),当 apache 启动应用程序时,SolrNet 决定将其传输到 solr 服务器的整个 URL 小写。如果应用程序处于这种状态,它会一直保持这种状态,直到重新启动(有时需要重新启动几次才能清除。)我们可能会进行 20 到 50 次或更多次重新启动,而不会出现此问题。或者有时它会每 2 或 3 次发生一次。
一个好的网址如下所示:
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}
错误的网址如下所示:
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).