簡體   English   中英

REST服務中Solr PHP客戶端配置管理的有效方法

[英]Efficient way for Solr PHP client configuration management in REST Service

我在 Solr 6.6.6 中有一些可搜索的數據。 我的 REST 客戶端是 PHP。 為了從 Solr 中搜索,我必須從 PHP 執行以下(示例)查詢

http://10.11.112.25:8983/solr/collection1/select?bf=recip(ms(NOW,date),3.16e-11,1,1)%5E2.2&boost=product(title1_depth,product(sum(arank,div(div(sum(cld2_score,cle_score),2),100),recip(pf_score,1,1,1)),sum(dup_stat,1)))&bq=group:ur_top_web%5E1.37&defType=edismax&fq=group:web%20OR%20group:ur_news*%20OR%20group:ur_blog%20OR%20group:ur_top_web*%20OR%20group:urpoetr*%20-pf_score:[0.7%20TO%201]%20OR%20NOT%20dup_stat1:[*%20TO%20*]&indent=on&mm=3&pf2=title%20content&pf3=title%20content&pf=title%20content&ps2=1&ps3=1&ps=10&q=%D9%BE%D8%A7%DA%A9%D8%B3%D8%AA%D8%A7%D9%86+%DA%A9%D8%A7+%D9%85%D8%B3%D8%AA%D9%82%D8%A8%D9%84&qf=title%20content&tie=0.4&wt=json&stopwords=true&lowercaseOperators=true&start=0&rows=10&hl=true&hl.snippets=5&hl.fl=title+content_t+content+id+url+summary&hl.method=original&hl.fragsize=100&f.summary.hl.fragsize=0&f.title.hl.fragsize=0&hl.requireFieldMatch=false&hl.alternateField=title+content_t+content+id+url+summary&hl.simple.post=</b>&hl.simple.pre=<b>&fl=title,content,url

有一種方法可以在 Solr 配置(如 XML 等)中配置所有這些,我只是從 PHP 調用一個小型查詢。 它還有助於同時控制多個客戶端的配置參數。

您可以在 Solr 配置中創建自定義搜索處理程序 這允許您指定 static 參數,這些參數將附加到您的客戶端進行的查詢中。

<requestHandler name="/custom" class="solr.SearchHandler">
  <lst name="appends">
    <str name="bf">recip(ms(NOW,date),3.16e-11,1,1)^2.2</str>
    ...
  </lst>
</requestHandler>

然后,您查詢/custom而不是/select

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM