Skip to content

Commit d70addd

Browse files
committed
added more documentation pages
1 parent d3b4f8a commit d70addd

File tree

8 files changed

+171
-1
lines changed

8 files changed

+171
-1
lines changed

new_docs/build/styles/layout.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ ul#nest h4.title {
188188
background:#eeeeee;
189189
}
190190

191-
192191
/* responsiveness */
193192
@media (max-width: 1040px) {
194193
body {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
template: layout.jade
3+
title: Beta Release Notes
4+
menusection: concepts
5+
menuitem: beta-release-notes
6+
---
7+
8+
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
template: layout.jade
3+
title: Breaking changes
4+
menusection: concepts
5+
menuitem: breaking-changes
6+
---
7+
8+
#Breaking changes
9+
10+
## Elasticsearch 1.0
11+
12+
Elasticsearch 1.0 comes with it's own set of breaking changes which [are all documented in the elasticsearch documentation](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/breaking-changes.html). This page describes breaking changes NEST introduces in its 1.0 release and to an extend how you should handle Elasticsearch 1.0 changes in your exisiting code base using NEST prior to NEST 1.0.
13+
14+
## NEST 1.0
15+
16+
### Strong named packages
17+
18+
Prior to 1.0 NEST came with a `NEST` and `NEST.Signed` nuget package. In 1.0 there is one package called `NEST` which is a signed strong named assembly. We follow the example of JSON.NET and only change our `AssemblyVersion` on major releases only update the `AssemblyFileVersion` for every release. This way you get most of the benefits of unsigned assemblies while still providing support for developers who's business guidelines mandates the usage of signed assemblies.
19+
20+
21+
### IElasticClient
22+
23+
The outer layer of NEST has been completely rewritten from scratch. Many calls will now have a different signature. Although the most common ones have been reimplemented as [extensions methods](http://github.com/elasticsearch/elasticsearch-net/tree/master/src/Nest/ConvenienceExtensions). Two notable changes should be outlined though.
24+
25+
#### Get() is now called Source()
26+
When I first wrote NEST back in 2010 I though it would be handy if the Get() operation returned only the document and if you want the full envelopped elasticsearch response you'd use `GetFull()`. This was rather confusing and on top of that Elasticsearch 1.0 now has it's own endpoint for getting JUST the document `_source`.
27+
Similarily `GetMany()` is now called `SourceMany()`.
28+
29+
### Renamed QueryResponse to SearchResponse
30+
31+
The fact that `client.Search<T>()` returns a `QueryResponse<T>` and not a `SearchResponse<T>` never felt right to me, NEST 1.0 therefor renamed `QueryResponse<T>` to `SearchResponse<T>`
32+
33+
#### Alias helpers
34+
35+
NEST 0.12.0 had some alias helpers, `SwapAlias()`, `GetIndicesPointingToAlias()` these have been removed in favor of just `Alias()` and `GetAliases()`. Especially the later could benefit from some extension methods that make the common use cases a bit easier to program with. These did not make the beta release.
36+
37+
#### Fields() vs SourceInclude()
38+
39+
Prior to Elasticsearch you could specify to return only certain fields and they would return like this:
40+
41+
...
42+
"fields" {
43+
"name" : "NEST"
44+
"followers.firstName: ["Martijn", "John", ...]
45+
}
46+
...
47+
48+
In many case this could be mapped to the type of DTO you give search (i.e in `.Search<DTO>()`). Elasticsearch 1.0 now always returns the fields as arrays.
49+
50+
...
51+
"fields" {
52+
"name" : ["NEST"]
53+
"followers.firstName: ["Martijn", "John", ...]
54+
}
55+
...
56+
57+
NEST 1.0 still supports this but is now a bit more verbose in how it supports mapping the fields back:
58+
59+
60+
var fields = _client.Get<DTO>(g => g
61+
.Id(4)
62+
.Fields(f => f.Name, f => f.Followers.First().FirstName)
63+
).Fields;
64+
var name = fields.FieldValue<DTO, string>(f => f.Name);
65+
var list = fields.FieldValue<DTO, string>(f=>f.Followers[0].FirstName);
66+
67+
`name` and `list` are of type `string[]`
68+
69+
### DocumentsWithMetaData
70+
71+
When you do a search with NEST 0.12 you'd get back a `QueryResponse<T>` with two ways to loop over your results. `.Documents` is an `IEnumerable<T>` and `.DocumentsWithMetaData` is and `IEnumerable<IHit<T>>` depending on your needs one of them might be easier to use.
72+
73+
Starting from NEST 1.0 `.DocumentsWithMetaData` is now called simply `.Hits`.
74+
75+
### int Properties
76+
77+
In quite a few places values that should have been `long` were mapped as `int` in NEST 0.12.0 which could be troublesome if you for instance have more than `2,147,483,647` matching documents. In my preperations for this release I helped port one of my former employees applications to Elasticsearch 1.1 and NEST 1.0 and found that this change had the most impact on the application and all of its models.
78+
79+
# Found another breaking change?
80+
81+
If you found another breaking chage please let us know on [the github issues](http://www.github.com/elasticsearch/elasticsearch-net/issues)
82+

new_docs/contents/building.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
template: layout.jade
3+
title: Building
4+
menusection: concepts
5+
menuitem: building
6+
---
7+
8+
# Building
9+
10+
Building `Elasticsearch.Net` and `NEST` should be super straightforward. Just fork and clone [the repository on github](https://github.com/elasticsearch/elasticsearch-net) and open `Elasticsearch.sln` and press build. Alternatively you can run `build.bat` from the root to build everything the resulting assemblies will be exported to `build/output`.
11+
12+
NEST builds strong named assemblies but if you do not have the key the build script and `pre build events` are in place to generate one for you. The project very much believes in the [F5 manifesto](http://www.khalidabuhakmeh.com/the-f5-manifesto-for-net-developers)
13+
14+
## Buildscript
15+
The buildscript depends on quite a few tools
16+
17+
* FAKE - F# make to script the build
18+
* Nuget - used to install some of the dependencies
19+
* NUnit - to run the tests after build
20+
* Nodejs - Use to generate the documentation
21+
* Wintersmith - Used to generate the documentation
22+
* sn.exe - used to check the validity of the signed assemblies during build/release procedures
23+
24+
All of these will be downloaded and installed locally in your repository the first time you run `build.bat`
25+
26+
**NOTE:** none of these are needed to build from within Visual Studio
27+
28+
### Build target
29+
Running `build.bat` will default to running the `Build` target which will create certificates in the right place if they do not exist, build the application and run all the unit tests. The resulting assemblies are placed in `build/output`.
30+
31+
### DocPreview target
32+
Running `build.bat DocPreview` will serve the files under `new_docs` at `http://localhost:8080` with live-reload setup. Usefull only when you are working on documentation.
33+
34+
### Release target
35+
Running `build.bat Release versionnumber` will create nuget packages in `output/_packages`. This could be useful if you need a feature that is not yet released you can temporarily switch to local nuget packages.
36+
37+
Release will call the build target and in addition patch the assembly files, build the documentation files.

new_docs/contents/contributing.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
template: index.jade
3+
title: Contributing
4+
menusection: concepts
5+
menuitem: contributing
6+
---
7+
8+
# Contributing
9+
10+
Contributing back to `Elasticsearch-Net` and `NEST` is very much appreciated.
11+
Whether you [feel the need to change one character](https://github.com/elasticsearch/elasticsearch-net/pull/536) or have a go at
12+
[mapping new API's](http://github.com/elasticsearch/elasticsearch-net/pull/376) no PR is too small or too big.
13+
14+
We do however ask you sign the [Elasticsearch CLA](http://www.elasticsearch.org/contributor-agreement/) before we can accept pull requests from you.
15+
16+
# Coding styleguide
17+
18+
The source code uses tabs instead of spaces for indentation.
19+
20+
I highly recommend the [editorconfig visual studio](http://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328) extension to automatically switch to tabs and back to your preferred/default settings for other projects.
21+
22+
In most cases we won't shun a PR just because it uses the wrong indentation settings though it'll be **very** much appreciated
23+

new_docs/contents/nuget-install.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
template: layout.jade
3+
title: Post nuget installation
4+
menusection: concepts
5+
menuitem: nuget-install
6+
---
7+
8+
# Succesfully installed
9+
10+
Hi! You are seeing this page because you've just installed `Elasticsearch.Net` or `NEST` in your solution. You should only be annoyed by this popup once.
11+
12+
If you are upgrading from an older `NEST` version please read the [breaking changes](/breaking-changes.html) section to help you get started porting your existing code over to new `NEST` version and what has changed in elasticsearch 1.0.
13+
14+
If you are starting a new project and have never used `NEST` or `Elasticsearch.Net` before please see the quick start sections to get a quick overview of how to start using elasticsearch from .NET.

new_docs/contents/styles/layout.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ ul#nest h4.title {
188188
background:#eeeeee;
189189
}
190190

191+
li {
192+
list-style:inherit;
193+
}
191194

192195
/* responsiveness */
193196
@media (max-width: 1040px) {

new_docs/templates/side_menu.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ aside#menu
22
ul
33
li
44
a(class=(page.metadata.menuitem == 'introduction')? "selected" : "",href='/') Home
5+
a(class=(page.metadata.menuitem == 'contributing')? "selected" : "",href='/contributing.html') Contributing
6+
a(class=(page.metadata.menuitem == 'building')? "selected" : "",href='/building.html') Building
7+
a(class=(page.metadata.menuitem == 'breaking-changes')? "selected" : "",href='/breaking-changes.html') 1.0 Breaking Changes
8+
a(class=(page.metadata.menuitem == 'release-notes')? "selected" : "",href='https://github.com/elasticsearch/elasticsearch-net/releases') Release Notes
59

610
ul#elasticsearch-net
711
h4.title Elasticsearch.Net

0 commit comments

Comments
 (0)