44
55namespace Nest
66{
7+ /// <summary>
8+ /// An indexed or artificial document with which to find likeness
9+ /// </summary>
710 [ InterfaceDataContract ]
811 [ ReadAs ( typeof ( LikeDocument < object > ) ) ]
912 public interface ILikeDocument
1013 {
14+ /// <summary>
15+ /// A document to find other documents like
16+ /// </summary>
1117 [ DataMember ( Name = "doc" ) ]
1218 [ JsonFormatter ( typeof ( SourceFormatter < object > ) ) ]
1319 object Document { get ; set ; }
1420
21+ /// <summary>
22+ /// The fields to use for likeness
23+ /// </summary>
1524 [ DataMember ( Name = "fields" ) ]
1625 Fields Fields { get ; set ; }
1726
27+ /// <summary>
28+ /// The id of an indexed document to find other documents like
29+ /// </summary>
1830 [ DataMember ( Name = "_id" ) ]
1931 Id Id { get ; set ; }
2032
33+ /// <summary>
34+ /// The index of an indexed document to find other documents like
35+ /// </summary>
2136 [ DataMember ( Name = "_index" ) ]
2237 IndexName Index { get ; set ; }
2338
39+ /// <summary>
40+ /// A different analyzer than the one defined for the target fields
41+ /// </summary>
2442 [ DataMember ( Name = "per_field_analyzer" ) ]
2543 IPerFieldAnalyzer PerFieldAnalyzer { get ; set ; }
2644
45+ /// <summary>
46+ /// The routing value of an indexed document to find other documents like
47+ /// </summary>
2748 [ DataMember ( Name = "routing" ) ]
2849 Routing Routing { get ; set ; }
2950 }
3051
52+ /// <inheritdoc />
3153 public abstract class LikeDocumentBase : ILikeDocument
3254 {
33- [ IgnoreDataMember ]
34- private Routing _routing ;
35-
55+ /// <inheritdoc />
3656 public object Document { get ; set ; }
3757
58+ /// <inheritdoc />
3859 public Fields Fields { get ; set ; }
3960
61+ /// <inheritdoc />
4062 public Id Id { get ; set ; }
63+
64+ /// <inheritdoc />
4165 public IndexName Index { get ; set ; }
4266
67+ /// <inheritdoc />
4368 public IPerFieldAnalyzer PerFieldAnalyzer { get ; set ; }
4469
45- public Routing Routing
46- {
47- get => _routing ?? ( Document == null ? null : new Routing ( Document ) ) ;
48- set => _routing = value ;
49- }
70+ /// <inheritdoc />
71+ public Routing Routing { get ; set ; }
5072 }
5173
74+ /// <inheritdoc cref="ILikeDocument" />
5275 public class LikeDocument < TDocument > : LikeDocumentBase
5376 where TDocument : class
5477 {
@@ -67,38 +90,39 @@ public LikeDocument(TDocument document)
6790 }
6891 }
6992
93+ /// <inheritdoc cref="ILikeDocument" />
7094 public class LikeDocumentDescriptor < TDocument > : DescriptorBase < LikeDocumentDescriptor < TDocument > , ILikeDocument > , ILikeDocument
7195 where TDocument : class
7296 {
73- private Routing _routing ;
74-
7597 public LikeDocumentDescriptor ( ) => Self . Index = typeof ( TDocument ) ;
7698
7799 object ILikeDocument . Document { get ; set ; }
78100 Fields ILikeDocument . Fields { get ; set ; }
79101 Id ILikeDocument . Id { get ; set ; }
80102 IndexName ILikeDocument . Index { get ; set ; }
81103 IPerFieldAnalyzer ILikeDocument . PerFieldAnalyzer { get ; set ; }
104+ Routing ILikeDocument . Routing { get ; set ; }
82105
83- Routing ILikeDocument . Routing
84- {
85- get => _routing ?? ( Self . Document == null ? null : new Routing ( Self . Document ) ) ;
86- set => _routing = value ;
87- }
88-
106+ /// <inheritdoc cref="ILikeDocument.Index" />
89107 public LikeDocumentDescriptor < TDocument > Index ( IndexName index ) => Assign ( index , ( a , v ) => a . Index = v ) ;
90108
109+ /// <inheritdoc cref="ILikeDocument.Id" />
91110 public LikeDocumentDescriptor < TDocument > Id ( Id id ) => Assign ( id , ( a , v ) => a . Id = v ) ;
92111
112+ /// <inheritdoc cref="ILikeDocument.Routing" />
93113 public LikeDocumentDescriptor < TDocument > Routing ( Routing routing ) => Assign ( routing , ( a , v ) => a . Routing = v ) ;
94114
115+ /// <inheritdoc cref="ILikeDocument.Fields" />
95116 public LikeDocumentDescriptor < TDocument > Fields ( Func < FieldsDescriptor < TDocument > , IPromise < Fields > > fields ) =>
96117 Assign ( fields , ( a , v ) => a . Fields = v ? . Invoke ( new FieldsDescriptor < TDocument > ( ) ) ? . Value ) ;
97118
119+ /// <inheritdoc cref="ILikeDocument.Fields" />
98120 public LikeDocumentDescriptor < TDocument > Fields ( Fields fields ) => Assign ( fields , ( a , v ) => a . Fields = v ) ;
99121
100- public LikeDocumentDescriptor < TDocument > Document ( TDocument document ) => Assign ( document , ( a , v ) => a . Document = v ) ;
122+ /// <inheritdoc cref="ILikeDocument.Document" />
123+ public LikeDocumentDescriptor < TDocument > Document ( TDocument document ) => Assign ( document , ( a , v ) => a . Document = v ) ;
101124
125+ /// <inheritdoc cref="ILikeDocument.PerFieldAnalyzer" />
102126 public LikeDocumentDescriptor < TDocument > PerFieldAnalyzer (
103127 Func < PerFieldAnalyzerDescriptor < TDocument > , IPromise < IPerFieldAnalyzer > > analyzerSelector
104128 ) =>
0 commit comments