2

次のリンクは、id、price:crazy_price_field などのフィールド エイリアスを使用できることを示しています。使用しようとしていますが、機能していません。 http://wiki.apache.org/solr/CommonQueryParameters#Field_alias https://issues.apache.org/jira/browse/SOLR-1205

私のクエリ:

http://localhost:8080/solr/ee_core/select?indent=on&version=2.2&q=\*%3A\*&fq=%2BinstanceId_index_store%3A217&start=0&rows=10&fl=description_index_store%2Cscore&qt=&wt=json

fl=description_index_store,scoreはフィールド名description_index_storescoreで正しい結果を返します

{
    "responseHeader": {
        "status": 0,"QTime": 1,
        "params": {
            "explainOther": "","fl": "description_index_store,score",
            "indent": "on","start": "0","q": "*:*","hl.fl": "","qt": "",
            "wt": "json","fq": "+instanceId_index_store:217","rows": "3",
            "version": "2.2"
        }
    },
    "response": {
        "numFound": 128,"start": 0,"maxScore": 1,
        "docs": [
            {
                "description_index_store": "Apple MacBook - Intel Core 2 Duo",
                "score": 1
            },
            {
                "description_index_store": "Apple MacBook - Intel Core 2 Duo",
                "score": 1
            },
            {
                "description_index_store": "HP Envy - 17.3\" - Intel Core i7",
                "score": 1
            }
        ]
    }
}

しかし、同じクエリでfl=description:description_index_store,scoreのようなエイリアスを使用しようとすると、フィールドが返されません。

{
    "responseHeader": {
        "status": 0,"QTime": 0,
        "params": {
            "explainOther": "","fl": "description:description_index_store,score",
            "indent": "on","start": "0","q": "*:*","hl.fl": "","qt": "",
            "wt": "json","fq": "+instanceId_index_store:217","rows": "3",
            "version": "2.2"
        }
    },
    "response": {
        "numFound": 128,"start": 0,"maxScore": 1,
        "docs": [
            {
                "score": 1
            },
            {
                "score": 1
            },
            {
                "score": 1
            }
        ]
    }
}
4

1 に答える 1

3

Solr の 4.0 バージョンに追加された、まだリリースされていない機能について言及しています。実際、その wiki ページのfl セクション内に感嘆符があり、次のコンテンツ (まだ fl セクション内) は Solr 4.0 でのみ使用できることを示しています。

SOLR-1205 の問題は、 SOLR-2444: Update fl syntax to support: pseudo fields, AS, translators, and wildcards内の他の改善点と共に対処されました。これは、Solr 4.0 でリリースされる予定です。Solr 4.0 ロードマップを見て、リリース時期を確認することをお勧めします。

于 2012-06-14T11:52:42.080 に答える