Skip to content

Commit 7b6e9b4

Browse files
committed
IRawElasticClient can now also take byte[] directly
1 parent 5bb7584 commit 7b6e9b4

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

src/Nest/RawElasticClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ protected ConnectionStatus DoRequest(string method, string path, object data = n
121121
private static byte[] _enter = Encoding.UTF8.GetBytes("\n");
122122
private byte[] PostData(object data)
123123
{
124+
var bytes = data as byte[];
125+
if (bytes != null)
126+
return bytes;
127+
124128
var s = data as string;
125129
if (s != null)
126130
return s.Utf8Bytes();

src/Tests/Nest.Tests.Integration/Search/QueryDSLTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void MatchAllShortcut()
3434
var results = this._client.Search<ElasticsearchProject>(s => s
3535
.From(0)
3636
.Size(10)
37-
.Fields(f => f.Id, f => f.Country)
37+
.Source(source=>source.Include(f => f.Id, f => f.Country))
3838
.SortAscending(f => f.LOC)
3939
.SortDescending(f => f.Country)
4040
.MatchAll()

src/Tests/Nest.Tests.Integration/Search/QueryResponseMapperTests.cs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,7 @@ public void DismaxQuery()
206206
);
207207
this.TestDefaultAssertions(queryResults);
208208
}
209-
[Test]
210-
public void FieldQuery()
211-
{
212-
var queryResults = this.SearchRaw<ElasticsearchProject>(
213-
@" { ""query"" : {
214-
""field"" : {
215-
""followers.firstName"" : ""+" + this._LookFor.ToLower() + @" -something else""
216-
}
217-
} }"
218-
);
219-
this.TestDefaultAssertions(queryResults);
220-
}
221-
[Test]
222-
public void ExtendedFieldQuery()
223-
{
224-
var queryResults = this.SearchRaw<ElasticsearchProject>(
225-
@" { ""query"" : {
226-
""field"" : {
227-
""followers.firstName"" : {
228-
""query"" : ""+" + this._LookFor.ToLower() + @" -something else"",
229-
""boost"" : 2.0,
230-
""enable_position_increments"": false
231-
}
232-
}
233-
} }"
234-
);
235-
this.TestDefaultAssertions(queryResults);
236-
}
209+
237210
[Test]
238211
public void FilteredQuery()
239212
{

0 commit comments

Comments
 (0)