在schema.xml 檔案中的配置,老是會忘記一些引數的作用,所以得記到部落格裡,就像一位同事所說,好記性不好爛部落格。
配置是否允許遠端訪問solr的配置檔案,比如http://localhost:8080/solr/admin/file?file=schema.xml或者solrconfig.xml
如果設定false,則訪問不到。。
其中omitnorms這個和文件長短有關
搜尋時使用的引數的一些作用
bf是文件的boost(可以在作索引的時候設定也可以在搜尋的時候動態計算 )
qf 欄位的權重評分(可以在作索引的時候設定也可以在搜尋的時候動態計算 ),qf只能在dismax方式下有效
mm 命中多少個term 返回結果
再續。。。。
使用dismax搜尋元件:
http://localhost:8080/solr/select/?q=美女&q.op=and&start=0&rows=20&fl=*&qt=dismax&bf=sum(recip(rord(public_time),1,56,7),recip(rord(public_time),1,112,14),recip(rord(public_time),1,180,30),recip(rord(public_time),1,720,180),recip(rord(public_time),1,720,360))^7+div(log(times),log(4))^30+map(hd,1,1,15,0)^4+div(log(totaltime),log(4))^30&qf=subject^1+tag^0.3
其中預設搜尋是text (test=subject+tag),所以q=美女,等於搜尋text:美女,但是由於後面有加個引數qf=subject^1+tag^0.3 ,所以搜尋 的是subject:美女 or tag:美女,且每個欄位都增加相應的權重
下面是除錯文件boost 和字段的boost
onon
0subject:mm or tag:mm
2.210−−
mm15−mm
−mm13−
love you haha
−love you haha14−
mm−13.277615 = (match) sum of:
12.204243 = (match) weight(subject:mm in 0), product of:
0.78980696 = queryweight(subject:mm), product of:
1.287682 = idf(docfreq=2, maxdocs=4)
0.6133556 = querynorm
15.452185 = (match) fieldweight(subject:mm in 0), product of:
1.0 = tf(termfreq(subject:mm)=1)
1.287682 = idf(docfreq=2, maxdocs=4)
12.0 = fieldnorm(field=subject, doc=0)
1.0733722 = (match) weight(tag:mm in 0), product of:
0.6133556 = queryweight(tag:mm), product of:
1.0 = idf(docfreq=3, maxdocs=4)
0.6133556 = querynorm
1.75 = (match) fieldweight(tag:mm in 0), product of:
1.0 = tf(termfreq(tag:mm)=1)
1.0 = idf(docfreq=3, maxdocs=4)
1.75 = fieldnorm(field=tag, doc=0)
−6.1021214 = (match) product of:
12.204243 = (match) sum of:
12.204243 = (match) weight(subject:mm in 0), product of:
0.78980696 = queryweight(subject:mm), product of:
1.287682 = idf(docfreq=2, maxdocs=4)
0.6133556 = querynorm
15.452185 = (match) fieldweight(subject:mm in 0), product of:
1.0 = tf(termfreq(subject:mm)=1)
1.287682 = idf(docfreq=2, maxdocs=4)
12.0 = fieldnorm(field=subject, doc=0)
0.5 = coord(1/2)
−0.5366861 = (match) product of:
1.0733722 = (match) sum of:
1.0733722 = (match) weight(tag:mm in 1), product of:
0.6133556 = queryweight(tag:mm), product of:
1.0 = idf(docfreq=3, maxdocs=4)
0.6133556 = querynorm
1.75 = (match) fieldweight(tag:mm in 1), product of:
1.0 = tf(termfreq(tag:mm)=1)
1.0 = idf(docfreq=3, maxdocs=4)
1.75 = fieldnorm(field=tag, doc=1)
0.5 = coord(1/2)
其中這三個文件的boost在提交的時候都設定為6,subject權重為2,tag權重為0.3,文件15在兩個欄位都命中,所以得分最高。
文件13命中subject,14命中tag,所以評分文件13高於14.
Solr的一些查詢引數
fl 是逗號分隔的列表,用來指定文件結果中應返回的field集。預設為 指所有的字段。deftype 指定query parser,常用deftype lucene,deftype dismax,deftype edismax q query。q.alt 當q欄位為空時,用於設定預設的query,通...
SOLR的一些錯誤
一 oct 18,2013 11 03 27 pm org.apache.catalina.core.standardcontext start severe error filterstart oct 18,2013 11 03 27 pm org.apache.catalina.core.sta...
solr7 3 的一些相關配置總結
data config.xml配置示例 unix timestamp 其中batchsize 1 這個配置很重要,如果不配置,百萬級資料全量匯入就記憶體溢位了 entity name video pk v id 這個pk也很重要,不配置匯入會很慢 deltaquery 這個查詢語句只能返回表的id鍵...