私はクラスのメンバーとしてDictionary<string, List<string>>
を持っています。私はautomapでデータを挿入することはできますが、辞書のキーや値でドキュメントを照会することはできません。一致クエリを使用すると、インデックス内のすべてが返されます。私は、用語、ネスト/非ネストされたクエリ、およびQueryStringクエリを使用しようとしましたが、いずれもドキュメントを返しません。DictionaryのNESTマッピング<string、List <string>>
class ESSchema
{
[String(Index = FieldIndexOption.NotAnalyzed, Store = false)]
public string Machine { get; set; }
[String(Index = FieldIndexOption.NotAnalyzed, Store = false)]
public string Filename { get; set; }
[Number(NumberType.Long, Store = false)]
public long BatchNumber { get; set; }
[String(Index = FieldIndexOption.NotAnalyzed, Store = false)]
public string Environment { get; set; } = null;
[Nested]
//[Object(Store = false)]
public Dictionary<string, List<string>> KeysValues { get; set; }
}
オートマップは、私が探しているものが正しいかどうかわからない次のマッピングに辞書を変換します。自動マッピング、あなたのDictionary<string, List<string>>
財産の場合NEST by default will map one level down in the object graph.は、辞書のパブリックプロパティが望ましくない、マップされてしまう
"keysValues": {
"type": "nested",
"properties": {
"comparer": {
"properties": {
},
"type": "object"
},
"count": {
"type": "integer"
},
"keys": {
"properties": {
"count": {
"type": "integer"
}
},
"type": "object"
},
"values": {
"properties": {
"count": {
"type": "integer"
}
},
"type": "object"
},
"item": {
"type": "string"
}
}
},
質問を少し編集しました。実際の質問を追加するには、それをさらに編集する必要があります。これまでのところ問題の声明であり、読者はあなたが望むものを推測することができます。 –