12

親子関係を持つオブジェクトを設定しようとしていますが、エラーが発生します:

[Elastica\Exception\ResponseException] RoutingMissingException[[myindex]/[comment]/[12345] にはルーティングが必要です]

タイプ conf からの抜粋:

article:
    _source:
        enabled: false
    mappings:
        ...

comment:
    _source:
        enabled: false
    _parent:
        type: article
        property: article_id
        identifier: id
    _routing:
        required: true
        path: article_id
    mappings:
        article:
            type: long
            index: not_analyzed
        ...

ここで何が欠けているのか理解できません....

Symfony2.3、FOSElasticaBundle 3.0、ElasticSearch 1.2.2 を使用しています

4

2 に答える 2

21

親子関係がある場合、ルーティングが親に依存するようになったため、子にアクセスしようとするたびに URL で親を指定する必要があります。

あなたの例では、次のことを試してください。

http://example.com/myindex/comment/12345 ?parent=[article_id]

于 2014-07-25T21:54:10.037 に答える
0

マッピングにタイプミスがありました。

comment:
    mappings:
        article_id: <-- was "article"
            type: long
            index: not_analyzed

多分これは誰かを助ける:)

于 2014-07-21T12:31:33.113 に答える