File tree 5 files changed +13
-8
lines changed
src/Nest.Tests.Integration
5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public void BulkIndexWithPercolate()
21
21
. Term ( f => f . Country , "netherlands" )
22
22
)
23
23
) ;
24
-
24
+ this . _client . Refresh < ElasticSearchProject > ( ) ;
25
25
var descriptor = new BulkDescriptor ( ) ;
26
26
27
27
// match against any doc
@@ -54,7 +54,7 @@ public void BulkIndexWithPercolate()
54
54
indexResponses . ElementAt ( 1 ) . Id . Should ( ) . BeEquivalentTo ( "3" ) ;
55
55
indexResponses . ElementAt ( 1 ) . Index . Should ( ) . BeEquivalentTo ( ElasticsearchConfiguration . DefaultIndex ) ;
56
56
indexResponses . ElementAt ( 1 ) . Type . Should ( ) . BeEquivalentTo ( this . _client . Infer . TypeName < ElasticSearchProject > ( ) ) ;
57
- indexResponses . First ( ) . Matches . Should ( ) . BeNull ( ) ;
57
+ indexResponses . ElementAt ( 1 ) . Matches . Should ( ) . BeNull ( ) ;
58
58
59
59
// cleanup
60
60
this . _client . UnregisterPercolator < ElasticSearchProject > ( query1 ) ;
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ public void BooleanProperty()
94
94
. Boolean ( s => s
95
95
. Name ( p => p . BoolValue ) //reminder .Name(string) exists too!
96
96
. Boost ( 1.4 )
97
- . IncludeInAll ( )
98
- . Index ( )
97
+ // .IncludeInAll() //makes no sense
98
+ // .Index() //since 0.90.5 this will throw an exception on elasticsearch.
99
99
. IndexName ( "bool_name_in_lucene_index" )
100
100
. NullValue ( false )
101
101
. Store ( )
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public void PercolateTypedDocWithQuery()
132
132
Assert . True ( percolateResponse . IsValid ) ;
133
133
Assert . True ( percolateResponse . OK ) ;
134
134
Assert . NotNull ( percolateResponse . Matches ) ;
135
- Assert . True ( percolateResponse . Matches . Contains ( name ) ) ;
135
+ Assert . True ( percolateResponse . Matches . Contains ( name ) , percolateResponse . Matches . Count ( ) . ToString ( ) ) ;
136
136
137
137
//should not match since we registered with the color blue
138
138
percolateResponse = this . _client . Percolate < ElasticSearchProject > ( p => p
Original file line number Diff line number Diff line change @@ -146,9 +146,12 @@ public void TestPartialFields()
146
146
[ Test ]
147
147
public void TermSuggest ( )
148
148
{
149
+ var country = this . _client . Search < ElasticSearchProject > ( s => s . Size ( 1 ) ) . Documents . First ( ) . Country ;
150
+ var wrongCountry = country + "x" ;
151
+
149
152
var results = this . _client . Search < ElasticSearchProject > ( s => s
150
153
. Query ( q => q . MatchAll ( ) )
151
- . TermSuggest ( "mySuggest" , m => m . SuggestMode ( SuggestMode . Always ) . Text ( "Sanskrti" ) . Size ( 1 ) . OnField ( "country" ) )
154
+ . TermSuggest ( "mySuggest" , m => m . SuggestMode ( SuggestMode . Always ) . Text ( wrongCountry ) . Size ( 1 ) . OnField ( "country" ) )
152
155
) ;
153
156
154
157
Assert . NotNull ( results ) ;
@@ -163,7 +166,9 @@ public void TermSuggest()
163
166
Assert . NotNull ( results . Suggest . Values . First ( ) . First ( ) . Options ) ;
164
167
Assert . GreaterOrEqual ( results . Suggest . Values . First ( ) . First ( ) . Options . Count ( ) , 1 ) ;
165
168
166
- Assert . AreEqual ( results . Suggest . Values . First ( ) . First ( ) . Options . First ( ) . Text , "Sanskrit" ) ;
169
+ Assert . AreEqual ( results . Suggest . Values . First ( ) . First ( ) . Options . First ( ) . Text , country ) ;
170
+
171
+ Assert . AreEqual ( results . Suggest [ "mySuggest" ] . First ( ) . Options . First ( ) . Text , country ) ;
167
172
}
168
173
169
174
[ Test ]
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public void BogusQuery()
38
38
Assert . False ( queryResults . IsValid ) ;
39
39
var error = queryResults . ConnectionStatus . Error ;
40
40
Assert . NotNull ( error ) ;
41
- Assert . True ( error . HttpStatusCode == System . Net . HttpStatusCode . InternalServerError ) ;
41
+ Assert . True ( error . HttpStatusCode == System . Net . HttpStatusCode . BadRequest , error . HttpStatusCode . ToString ( ) ) ;
42
42
}
43
43
44
44
[ Test ]
You can’t perform that action at this time.
0 commit comments