Solr的一些查詢參數

來源:互聯網
上載者:User

標籤:Lucene   使用   os   io   for   ar   cti   amp   

fl: 是逗號分隔的列表,用來指定文檔結果中應返回的 Field 集。預設為 “*”,指所有的欄位。
defType: 指定query parser,常用defType=lucene, defType=dismax, defType=edismax
q: query。
q.alt: 當q欄位為空白時,用於設定預設的query,通常設定q.alt為*:*。
qf: query fields,指定solr從哪些field中搜尋。
pf: 用於指定一組field,當query完全符合pf指定的某一個field時,來進行boost。
簡言之pf的作用是boosting phrases over words。
fq: filter query,過慮查詢。
mm: minimal should match。Solr支援三種查詢clause,即“必須出現”, “不能出現”和“可以出現”,分別對應於AND, -, OR。
在預設情況下,使用OR這個clause。mm用於設定在使用OR這個clause時,需要出現最少的滿足條件的clause數量,詳見這裡。
ps: Phrase Slop. Amount of slop on phrase queries built for "pf" fields (affects boosting). ps is about pf parameter. ps affects boosting, if you play with ps value, numFound and result set do not change. But the order of result set change. This is about the phrase query that is constructed out of the entire "q" param. ps is slop applied to the phrases created from the entire query for evaluating pf boosts. ps will only (potentially) change the ranked ordering of your result set, by loosening what a "phrase match" means to the pf boost.
ps的例子:
Lets say your query is apache solr. (without quotation marks)
Lets say these three documents contains all of these words and returned.
1-) solr is built on the top of apache lucene.
2-) apache solr is fast, mature and popular.
3-) solr is hosted under apache umbrella.
Even if you don‘t use pf and ps parameters, those documents will be in result set anyway. Lets say that they appear in this order 1,2,3.
Then we include pf and ps parameter, q=apache solr&pf=title^1.2&ps=1
Second document is boosted, lets say it comes first now. The order is changed. The documents - that have the all query words close each other - are boosted. Again the same three documents are returned.

qs: Query Phrase Slop. Amount of slop on phrase queries explicitly included in the user‘s query string (in qf fields; affects matching). qs affects matching. If you play with qs, numFound changes. This parameter is about when you have explicit phrase query in your raw query. i.e. &q="apache lucene" . qs is slop applied to phrases explicitly in the &q with double quotes. qs will (potentially) change your result set.

tie: tie breaker。
bq: 對某個field的value進行boost,例如brand:IBM^5.0。
bf: Function (with optional boosts) that will be included in the user‘s query to influence the score. Any function supported natively by Solr can be used, along with a boost value, e.g.: recip(rord(myfield),1,2,3)^1.5wt: writer type,指定輸出格式,可以有 xml, json, php, phps。
q.op: 覆蓋schema.xml的defaultOperator(有空格時用"AND"還是用"OR"操作邏輯)。
df: 預設的查詢欄位。
qt: query type,指定那個類型來處理查詢請求,一般不用指定,預設是standard。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.