1

I have a more like this query which I would like to update to return newer documents first. According to the documentation, I would need to add recip(ms(NOW,mydatefield),3.16e-11,1,1) to my query.

But when I try to add it to either of mlt.qf or bf parameters. The results stay exactly the same.

This is my query:

/solr/mlt?

q=id:cms.article.137861

&defType=edismax

&rows=3

&indent=on

&mlt.fl=series_id,tags,title,text

&mlt.qf=show_id text^1.1 title^1.1 tags^90

&wt=json

&fl=url,title,tags,django_id,content_type_id

&bf=recip(ms(NOW,pub_date),3.16e-11,1,1)

4

2 に答える 2

1

これはsolr wikiから取得したものです(ダウンしていますが、キャッシュされています)これはあなたが探しているものだと思います。

新しいドキュメントのスコアを上げるにはどうすればよいですか

日付による明示的な並べ替えを行います (関連性スコアは無視されます)。新しいドキュメントほど大きいインデックス時間ブーストを使用します。FunctionQuery を使用して、日付フィールドに基づいてスコアに影響を与えます。Solr 1.3 では、recip(rord(myfield),1,1000,1000) の形式を使用します。Solr 1.4 では、recip(ms(NOW,mydatefield),3.16e-11,1,1) httpの形式を使用します。 ://lucene.apache.org/solr/api/org/apache/solr/search/function/ReciprocalFloatFunction.html http://lucene.apache.org/solr/api/org/apache/solr/search/BoostQParserPlugin. html 製品が新しいほどスコアが高くなる「ipod」のクエリの完全な例は次のとおりです。

http://localhost:8983/solr/select?q= {!boost b=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)}ipod クエリを複数に分解することで実装を簡素化できます引数:

http://localhost:8983/solr/select?q= {!boost b=$dateboost v=$qq}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qq=iPod Nowメインの「q」引数と「dateboost」引数は、solrconfig.xml の検索ハンドラーでデフォルトとして指定できます。クライアントは、ユーザー クエリである「qq」を渡すだけで済みます。

dismax クエリなどの別のクエリ タイプをブーストするには、ブースト クエリの値が完全なサブクエリであるため、{!querytype} 構文を使用できます。あるいは、ブースト ローカル パラメータで defType パラメータを使用して、デフォルト タイプを dismax に設定することもできます。他の dismax パラメータは、トップレベルのパラメータとして設定できます。

http://localhost:8983/solr/select?q= {!boost b=$dateboost v=$qq defType=dismax}&dateboost=recip(ms(NOW,manufacturedate_dt),3.16e-11,1,1)&qf =text&pf=text&qq=ipod 過度のメモリ消費を防ぐために、精度を下げて使用することを検討してください。代わりに recip(ms(NOW/HOUR,mydatefield),3.16e-11,1,1) を使用します。詳細については、このスレッドを参照してください。

于 2012-04-18T09:13:08.353 に答える
0

どうやらあなたの日付フィールドはTrieDateではありません

于 2012-06-22T05:07:27.410 に答える