|
52 | 52 | * For each pair of types being tested, it builds a main index called "index" containing a single document with as many fields as |
53 | 53 | * types being tested on the left of the pair, and then creates that many other lookup indexes, each with a single document containing |
54 | 54 | * exactly two fields: the field to join on, and a field to return. |
| 55 | + * The assertion is that for valid combinations, the return result should exist, and for invalid combinations an exception should be thrown. |
| 56 | + * If no exception is thrown, and no result is returned, our validation rules are not aligned with the internal behaviour (ie. a bug). |
| 57 | + * Since the `LOOKUP JOIN` command requires the match field name to be the same between the main index and the lookup index, |
| 58 | + * we will have field names that correctly represent the type of the field in the main index, but not the type of the field |
| 59 | + * in the lookup index. This can be confusing, but it is important to remember that the field names are not the same as the types. |
55 | 60 | * For example, if we are testing the pairs (double, double), (double, float), (float, double) and (float, float), |
56 | 61 | * we will create the following indexes: |
57 | 62 | * <dl> |
58 | | - * <dt>index_double_double: containing</dt> |
59 | | - * <dd>Index containing da single document with a field of type 'double' like: <pre> |
| 63 | + * <dt>index_double_double</dt> |
| 64 | + * <dd>Index containing a single document with a field of type 'double' like: <pre> |
60 | 65 | * { |
61 | 66 | * "field_double": 1.0, // this is mapped as type 'double' |
62 | 67 | * "other": "value" |
|
65 | 70 | * <dt>index_double_float</dt> |
66 | 71 | * <dd>Index containing a single document with a field of type 'float' like: <pre> |
67 | 72 | * { |
68 | | - * "field_double": 1.0, // this is mapped as type 'float' |
| 73 | + * "field_double": 1.0, // this is mapped as type 'float' (a float with the name of the main index field) |
69 | 74 | * "other": "value" |
70 | 75 | * } |
71 | 76 | * </pre></dd> |
72 | 77 | * <dt>index_float_double</dt> |
73 | 78 | * <dd>Index containing a single document with a field of type 'double' like: <pre> |
74 | 79 | * { |
75 | | - * "field_float": 1.0, // this is mapped as type 'double' |
| 80 | + * "field_float": 1.0, // this is mapped as type 'double' (a double with the name of the main index field) |
76 | 81 | * "other": "value" |
77 | 82 | * } |
78 | 83 | * </pre></dd> |
|
86 | 91 | * <dt>index</dt> |
87 | 92 | * <dd>Index containing document like: <pre> |
88 | 93 | * { |
89 | | - * "field_double": 1.0, |
90 | | - * "field_float": 1.0 |
| 94 | + * "field_double": 1.0, // this is mapped as type 'double' |
| 95 | + * "field_float": 1.0 // this is mapped as type 'float' |
91 | 96 | * } |
92 | 97 | * </pre></dd> |
93 | 98 | * </dl> |
|
0 commit comments