2017-05-15 4 views
0
Solr Version: 6.3.0 
Cloud: Yes 
Shards: Single(1) 
Data Size: 50GB 
Records: 12M 

特定のコレクションから関連IDを検索しようとするSolr Joinクエリがあります(はい自己結合)。これにより、パフォーマンスが低下しています。Solr結合パーサーのパフォーマンスの問題

Solrは上記のqフィルタに関係なくfrom_fieldからすべての項をスキャンしてからto_field項と交差しようとします。 Joinパーサのto_fieldと交差する前に、solrに条件をフィルタリングするよう求めることができる方法はありますか?

私たちは、与えられたsolrフィールドの約9Mの言葉を持っています。これは、パフォーマンスヒットの原因と思われます。

"join": { 

    "{!join from=from_field to=to_field fromIndex=insight_pats_1_shard1_replica1}to_field: \u0001\u0000\u0000\u0000\u0000\u0000\u0003X\u0002H": { 
     "time": 16824, 
     "fromSetSize": 1, 
     "toSetSize": 0, 
     "fromTermCount": 8561723, 
     "fromTermTotalDf": 8561723, 
     "fromTermDirectCount": 8561505, 
     "fromTermHits": 0, 
     "fromTermHitsTotalDf": 0, 
     "toTermHits": 0, 
     "toTermHitsTotalDf": 0, 
     "toTermDirectCount": 0, 
     "smallSetsDeferred": 0, 
     "toSetDocsAdded": 0 
    } 

}, 
"rawquerystring": "*:*", 
"querystring": "*:*", 
"parsedquery": "(+MatchAllDocsQuery(*:*))/no_coord", 
"parsedquery_toString": "+*:*", 
"explain": { }, 
"QParser": "ExtendedDismaxQParser", 
"altquerystring": null, 
"boost_queries": null, 
"parsed_boost_queries": [ ], 
"boostfuncs": null, 
"filter_queries": [ 

    "account_ids:1", 
    "{!join from=from_field to=to_field fromIndex=insight_pats_1}to_field:7733576" 

], 
"parsed_filter_queries": [ 

    "account_ids:1", 
    "JoinQuery({!join from=from_field to=to_field fromIndex=insight_pats_1_shard1_replica1}to_field: \u0001\u0000\u0000\u0000\u0000\u0000\u0003X\u0002H)" 

] 

答えて

0

はJoinQueryParser

  • デフォルトで

    ScoreJoinQParser

    • 可能な参加パーサの2種類があります!参加はJoinQueryParserを使用していますが、大きさ数百万のレコードを結合するための最適ではありません。

      SOLRにScoreJoinQParserの使用を依頼するには、!join parserコマンドでパラメータscore = noneを以下のように追加します。

      http://localhost:8983/solr/mycollection/select?fq={!join from=from_field to=to_field fromIndex=from_collection score=none}&indent=on&q=*:*&wt=json&debugQuery=on 
      

      は、我々はfrom_fieldの用語は800万

      の範囲内にあるパフォーマンスが30倍の改善を達成することができます