File tree Expand file tree Collapse file tree 5 files changed +13
-8
lines changed
src/Nest.Tests.Integration Expand file tree Collapse file tree 5 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public void BulkIndexWithPercolate()
2121 . Term ( f => f . Country , "netherlands" )
2222 )
2323 ) ;
24-
24+ this . _client . Refresh < ElasticSearchProject > ( ) ;
2525 var descriptor = new BulkDescriptor ( ) ;
2626
2727 // match against any doc
@@ -54,7 +54,7 @@ public void BulkIndexWithPercolate()
5454 indexResponses . ElementAt ( 1 ) . Id . Should ( ) . BeEquivalentTo ( "3" ) ;
5555 indexResponses . ElementAt ( 1 ) . Index . Should ( ) . BeEquivalentTo ( ElasticsearchConfiguration . DefaultIndex ) ;
5656 indexResponses . ElementAt ( 1 ) . Type . Should ( ) . BeEquivalentTo ( this . _client . Infer . TypeName < ElasticSearchProject > ( ) ) ;
57- indexResponses . First ( ) . Matches . Should ( ) . BeNull ( ) ;
57+ indexResponses . ElementAt ( 1 ) . Matches . Should ( ) . BeNull ( ) ;
5858
5959 // cleanup
6060 this . _client . UnregisterPercolator < ElasticSearchProject > ( query1 ) ;
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ public void BooleanProperty()
9494 . Boolean ( s => s
9595 . Name ( p => p . BoolValue ) //reminder .Name(string) exists too!
9696 . 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.
9999 . IndexName ( "bool_name_in_lucene_index" )
100100 . NullValue ( false )
101101 . Store ( )
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public void PercolateTypedDocWithQuery()
132132 Assert . True ( percolateResponse . IsValid ) ;
133133 Assert . True ( percolateResponse . OK ) ;
134134 Assert . NotNull ( percolateResponse . Matches ) ;
135- Assert . True ( percolateResponse . Matches . Contains ( name ) ) ;
135+ Assert . True ( percolateResponse . Matches . Contains ( name ) , percolateResponse . Matches . Count ( ) . ToString ( ) ) ;
136136
137137 //should not match since we registered with the color blue
138138 percolateResponse = this . _client . Percolate < ElasticSearchProject > ( p => p
Original file line number Diff line number Diff line change @@ -146,9 +146,12 @@ public void TestPartialFields()
146146 [ Test ]
147147 public void TermSuggest ( )
148148 {
149+ var country = this . _client . Search < ElasticSearchProject > ( s => s . Size ( 1 ) ) . Documents . First ( ) . Country ;
150+ var wrongCountry = country + "x" ;
151+
149152 var results = this . _client . Search < ElasticSearchProject > ( s => s
150153 . 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" ) )
152155 ) ;
153156
154157 Assert . NotNull ( results ) ;
@@ -163,7 +166,9 @@ public void TermSuggest()
163166 Assert . NotNull ( results . Suggest . Values . First ( ) . First ( ) . Options ) ;
164167 Assert . GreaterOrEqual ( results . Suggest . Values . First ( ) . First ( ) . Options . Count ( ) , 1 ) ;
165168
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 ) ;
167172 }
168173
169174 [ Test ]
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public void BogusQuery()
3838 Assert . False ( queryResults . IsValid ) ;
3939 var error = queryResults . ConnectionStatus . Error ;
4040 Assert . NotNull ( error ) ;
41- Assert . True ( error . HttpStatusCode == System . Net . HttpStatusCode . InternalServerError ) ;
41+ Assert . True ( error . HttpStatusCode == System . Net . HttpStatusCode . BadRequest , error . HttpStatusCode . ToString ( ) ) ;
4242 }
4343
4444 [ Test ]
You can’t perform that action at this time.
0 commit comments