File tree 3 files changed +53
-0
lines changed
3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ public static void SetRouteParameters<TParameters>(
38
38
pathInfo . Index = inferrer . IndexNames ( path . Indices ) ;
39
39
else if ( path . AllIndices . GetValueOrDefault ( false ) && ! pathInfo . Type . IsNullOrEmpty ( ) )
40
40
pathInfo . Index = "_all" ;
41
+ else if ( ! path . AllIndices . GetValueOrDefault ( false ) && pathInfo . Index . IsNullOrEmpty ( ) )
42
+ pathInfo . Index = inferrer . DefaultIndex ;
41
43
42
44
}
43
45
public static void SetRouteParameters < TParameters , T > (
Original file line number Diff line number Diff line change 235
235
<Compile Include =" ObjectInitializer\Aliases\GetAliasesRequestTests.cs" />
236
236
<Compile Include =" ObjectInitializer\Aliases\AliasRequestTests.cs" />
237
237
<Compile Include =" ObjectInitializer\Nodes\NodesHotThreadsRequestTests.cs" />
238
+ <Compile Include =" ObjectInitializer\Search\SearchRequestUntypedTests.cs" />
238
239
<Compile Include =" ObjectInitializer\Status\StatusRequestTests.cs" />
239
240
<Compile Include =" ObjectInitializer\IndicesStats\IndicesStatsRequestTests.cs" />
240
241
<Compile Include =" ObjectInitializer\ClusterState\ClusterStateRequestTests.cs" />
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Reflection ;
5
+ using Elasticsearch . Net ;
6
+ using FluentAssertions ;
7
+ using Nest . Resolvers ;
8
+ using Nest . Tests . MockData . Domain ;
9
+ using NUnit . Framework ;
10
+
11
+ namespace Nest . Tests . Unit . ObjectInitializer . Search
12
+ {
13
+ [ TestFixture ]
14
+ public class SearchRequestUntypedTests : BaseJsonTests
15
+ {
16
+ private readonly IElasticsearchResponse _status ;
17
+
18
+ public SearchRequestUntypedTests ( )
19
+ {
20
+ QueryContainer query = new TermQuery ( )
21
+ {
22
+ Field = Property . Path < ElasticsearchProject > ( p=> p . Name ) ,
23
+ Value = "value"
24
+ } && new PrefixQuery ( )
25
+ {
26
+ Field = "prefix_field" ,
27
+ Value = "prefi" ,
28
+ Rewrite = RewriteMultiTerm . ConstantScoreBoolean
29
+ } ;
30
+
31
+ var request = new SearchRequest
32
+ {
33
+ From = 0 ,
34
+ Size = 20 ,
35
+ Query = query
36
+
37
+ } ;
38
+ var response = this . _client . Search < ElasticsearchProject > ( request ) ;
39
+ this . _status = response . ConnectionStatus ;
40
+ }
41
+
42
+ [ Test ]
43
+ public void Url ( )
44
+ {
45
+ this . _status . RequestUrl . Should ( ) . EndWith ( "/nest_test_data/_search" ) ;
46
+ this . _status . RequestMethod . Should ( ) . Be ( "POST" ) ;
47
+ }
48
+
49
+ }
50
+ }
You can’t perform that action at this time.
0 commit comments