1

More Like This クエリを使用して、Elasticsearch で同様のドキュメントを取得しようとしています。しばらくは有効な解決策がありましたが、その後ドキュメント構造が変更され、各ドキュメントの親ができました。MLTを使用して子ドキュメントが見つからないことを示すものは何も見つかりませんが、それはそのようです。なぜこれがうまくいかないのか、誰かが光を当てることができますか?

エラーは発生していませんが、結果にドキュメントがありません

種類

car: {
  _parent: {
    type: "dealer"
  },
  _routing: {
    required: true
  },
  properties: {
    id: {
      type: "string"
    },
    make: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    model: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    modelGroup: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    modelRaw: {
      type: "string",
      analyzer: "model_raw_analyzer"
    },

    fuel: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    gearbox: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    additionalVehicleData: {
      properties: {
        bodyType: {
          type: "string"
        },
        color: {
          type: "string"
        },
        colorGroup: {
          type: "string"
        },
        cylinderVolumeCC: {
          type: "long"
        },
        engineEffectHp: {
          type: "long"
        },
        engineEffectKw: {
          type: "long"
        },
        enviromentClass: {
          type: "string"
        },
        fourWheelDrive: {
          type: "boolean"
        },
        fuels: {
          properties: {
            co2Emissions: {
              type: "double"
            },
            engineEffectKw: {
              type: "long"
            },
            name: {
              type: "string"
            }
          }
        },
        height: {
          type: "long"
        },
        length: {
          type: "long"
        },
        make: {
          type: "string"
        },
        maxSpeed: {
          type: "string"
        },
        noPassangers: {
          type: "long"
        },
        weight: {
          type: "long"
        },
        width: {
          type: "long"
        }
      }
    },
    bodyType: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    },
    equipment: {
      type: "string",
      index_analyzer: "swedish_edge_ngram",
      search_analyzer: "swedish"
    },
    freetextColor: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    }
    /*** MORE PROPERTIES HERE ... ***/
  }
}
dealer: {
  properties: {
   id: {
      type: "string"
    },
    name: {
      type: "string",
      fields: {
        raw: {
          type: "string",
          index: "not_analyzed"
        }
      }
    }
    /*** MORE PROPERTIES HERE ... ***/
  }
}

car以前に機能した私のクエリは、ID8379511が有効な車の IDであるメイン インデックスと type に対する以下のように単純でした。

{
  "from": 0,
  "size": 10,
  "query": {
    "more_like_this": {
      "ids": ["8348446"],
      "min_term_freq":1,
      "min_doc_freq":1
      }
  }
}

このように「ids」の代わりに「like_text」を使用するようにクエリを変更すると機能しますが、より多くのパラメーターに基づいて検索結果を見つけるためのロジックが必要だったので、実際には私が求めているものではありませんcar

{
  "from": 0,
  "size": 10,
  "query": {
    "more_like_this": {
      "like_text": "volvo",
      "min_term_freq":1,
      "min_doc_freq":1
      }
  }
}

ここに何かアイデアはありますか?

4

0 に答える 0