Skip to content

Commit f7106a1

Browse files
author
Moran
committed
Merge remote-tracking branch 'origin/master'
2 parents 15ba526 + 0564ae1 commit f7106a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1734
-590
lines changed

src/HackerNews.Indexer/Program.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Xml;
6-
using HackerNews.Indexer.Domain;
7-
using Nest;
8-
using System.Diagnostics;
9-
using System.Net;
10-
using System.Threading.Tasks;
11-
using System.Threading;
12-
13-
namespace HackerNews.Indexer
14-
{
15-
class Program
16-
{
17-
/// <summary>
18-
/// Depends on hn_full_11-07-2010.xml which you can download from:
19-
/// http://api.ihackernews.com/torrents/hn_full_11-07-2010.zip.torrent
20-
///
21-
/// When run from debug make sure to change the default debug arguments.
22-
/// <param name="args">Full filepath to hn_full_11-07-2010.xml</param>
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Xml;
6+
using HackerNews.Indexer.Domain;
7+
using Nest;
8+
using System.Diagnostics;
9+
using System.Net;
10+
using System.Threading.Tasks;
11+
using System.Threading;
12+
13+
namespace HackerNews.Indexer
14+
{
15+
class Program
16+
{
17+
/// <summary>
18+
/// Depends on hn_full_11-07-2010.xml which you can download from:
19+
/// http://api.ihackernews.com/torrents/hn_full_11-07-2010.zip.torrent
20+
///
21+
/// When run from debug make sure to change the default debug arguments.
22+
/// <param name="args">Full filepath to hn_full_11-07-2010.xml</param>
2323
static void Main(string[] args)
2424
{
2525
var filePath = args.First();
@@ -34,7 +34,7 @@ static void Main(string[] args)
3434
elasticSettings.Host, connectionStatus.Error.OriginalException.Message);
3535
Console.Read();
3636
return;
37-
}
37+
}
3838

3939

4040
var reader = new XmlTextReader(filePath);
@@ -126,6 +126,6 @@ static void Main(string[] args)
126126
}
127127

128128

129-
}
130-
}
131-
}
129+
}
130+
}
131+
}

src/Nest.Connection.Thrift/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was generated by a tool.
4-
// Runtime Version:4.0.30319.17929
4+
// Runtime Version:4.0.30319.18010
55
//
66
// Changes to this file may cause incorrect behavior and will be lost if
77
// the code is regenerated.
@@ -21,7 +21,7 @@
2121
[assembly: ComVisible(false)]
2222
[assembly: CLSCompliant(true)]
2323
[assembly: Guid("4d165338-2060-4641-8be6-b7aacbdee52d")]
24-
[assembly: AssemblyVersion("0.9.9.0")]
25-
[assembly: AssemblyFileVersion("0.9.9.0")]
24+
[assembly: AssemblyVersion("0.9.12.0")]
25+
[assembly: AssemblyFileVersion("0.9.12.0")]
2626

2727

src/Nest.Tests.Integration/Core/DeleteTests.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,8 @@ namespace Nest.Tests.Integration.Core
1010
[TestFixture]
1111
public class DeleteTests : BaseElasticSearchTests
1212
{
13-
[Test]
14-
public void HitsMaxScoreIsSet()
15-
{
16-
//arrange
17-
//pull existing example through method we know is functional based on other passing unit tests
18-
var queryResults = this.ConnectedClient.SearchRaw<ElasticSearchProject>(
19-
@" { ""query"" : {
20-
""query_string"" : {
21-
""query"" : ""*""
22-
}
23-
} }"
24-
);
25-
26-
var hits = queryResults.Hits;
27-
28-
Assert.AreEqual(1, hits.MaxScore);
29-
Assert.AreEqual(hits.Hits.Max(h => h.Score), hits.MaxScore);
30-
}
13+
14+
3115
[Test]
3216
public void ShouldThowOnNullId()
3317
{

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,52 @@ public void BogusQuery()
4040
Assert.NotNull(error);
4141
Assert.True(error.HttpStatusCode == System.Net.HttpStatusCode.InternalServerError);
4242
}
43+
44+
[Test]
45+
public void HitsMaxScoreIsSet()
46+
{
47+
//arrange
48+
//pull existing example through method we know is functional based on other passing unit tests
49+
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s => s
50+
.QueryString("*")
51+
//.SortAscending(p => p.Id)
52+
);
53+
54+
var hits = queryResults.Hits;
55+
56+
Assert.AreEqual(1, hits.MaxScore);
57+
Assert.AreEqual(hits.Hits.Max(h => h.Score), hits.MaxScore);
58+
}
59+
60+
[Test]
61+
public void HitsSortsIsSet()
62+
{
63+
//arrange
64+
//pull existing example through method we know is functional based on other passing unit tests
65+
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s => s
66+
.QueryString("*")
67+
.SortAscending("_score")
68+
.SortDescending(p=>p.Id)
69+
);
70+
71+
var hits = queryResults.Hits;
72+
73+
Assert.True(hits.Hits.All(h=>h.Sorts.Count() == 2));
74+
}
75+
[Test]
76+
public void HitsSortsIsSetWithStringSort()
77+
{
78+
var queryResults = this.ConnectedClient.Search<ElasticSearchProject>(s => s
79+
.QueryString("*")
80+
.SortAscending(p=>p.Name.Suffix("sort"))
81+
.SortDescending(p => p.Id)
82+
);
83+
84+
var hits = queryResults.Hits;
85+
86+
Assert.True(hits.Hits.All(h => h.Sorts.Count() == 2));
87+
}
88+
4389
[Test]
4490
public void BoolQuery()
4591
{

src/Nest.Tests.Integration/Test.Designer.cs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Nest.Tests.Integration/Test.settings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Value Profile="(Default)">localhost</Value>
1616
</Setting>
1717
<Setting Name="Uri" Type="System.Uri" Scope="User">
18-
<Value Profile="(Default)">http://127.0.0.1:9200</Value>
18+
<Value Profile="(Default)">http://127.0.0.1.:9200</Value>
1919
</Setting>
2020
</Settings>
2121
</SettingsFile>

src/Nest.Tests.Integration/app.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<value>localhost</value>
3535
</setting>
3636
<setting name="Uri" serializeAs="String">
37-
<value>http://127.0.0.1:9200</value>
37+
<value>http://127.0.0.1.:9200</value>
3838
</setting>
3939
</Nest.Tests.Integration.Test>
4040
</userSettings>

0 commit comments

Comments
 (0)