0

Solr4.7.2 の結果を特定の関連する順序でグループ化し、solr 検索を行っているタイトル、概要、およびコンテンツの 3 つの列があるようにします。

現在、このクエリを実行してシンプルクエリパーサーを使用しています。

select?q=2016&fl=title%2Csummary%2Ccontent%2Cscore&wt=json&indent=true

文字列「2016」を検索して結果を表示しています

{
  "responseHeader": {
    "status": 0,
    "QTime": 1,
    "params": {
      "q": "2016",
      "indent": "true",
      "fl": "title,summary,content,score",
      "wt": "json"
    }
  },
  "response": {
    "numFound": 5,
    "start": 0,
    "maxScore": 0.643841,
    "docs": [{
      "title": "Title",
      "summary": "2016 which u",
      "score": 0.643841
    }, {
      "title": "2016 which U The Most",
      "summary": "Summary",
      "score": 0.48288077
    }, {
      "content": [" \n \n  \n  \n  \n  \n  \n \n  def 2016 which U abcd\n \n  "],
      "score": 0.3219205
    }, {
      "content": [" \n \n  \n  \n  \n  \n  \n \n  def 2016 which U abcd\n \n  "],
      "score": 0.3219205
    }, {
      "content": [" \n \n  \n  \n  \n  \n  \n \n  2016 which U The most Important \n \n  "],
      "score": 0.3219205
    }]
  }
}

ここで、タイトルの完全一致が最初に関連性の順序で表示されるように結果をグループ化し、次に完全一致が表示され、次に完全一致が表示され、次に完全一致完全一致が表示されるようにします。別のグループでは、スコアの低いタイル > 概要 > コンテンツを表示する必要があります。

例の場合。期待される結果は

{
  "responseHeader": {
    "status": 0,
    "QTime": 1,
    "params": {
      "q": "2016",
      "indent": "true",
      "fl": "title,summary,content,score",
      "wt": "json"
    }
  },
  "response": {
    "numFound": 5,
    "start": 0,
    "maxScore": 0.643841,
    "docs": [{
      "title": "2016 which U The Most",
      "summary": "Summary",
      "score": 0.48288077
    },{
      "title": "Title",
      "summary": "2016 which u",
      "score": 0.643841
    },{
      "content": [" \n \n  \n  \n  \n  \n  \n \n  2016 which U The most Important \n \n  "],
      "score": 0.3219205
    },{
      "content": [" \n \n  \n  \n  \n  \n  \n \n  def 2016 which U abcd\n \n  "],
      "score": 0.3219205
    }, {
      "content": [" \n \n  \n  \n  \n  \n  \n \n  def 2016 which U abcd\n \n  "],
      "score": 0.3219205
    }, ]
  }
}

qf=title^2 サマリー コンテンツを適用して dismax クエリ パーサーを使用しようとしましたが、結果が表示されません。

4

0 に答える 0