Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions Elasticsearch.FSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@ Microsoft Visual Studio Solution File, Format Version 12.00
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DC92765B-25F4-41AB-A282-282B5399ACCA}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
README.md = README.md
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Elasticsearch.FSharp", "src\Elasticsearch.FSharp\Elasticsearch.FSharp.fsproj", "{69E3270B-8AC7-433A-83F7-D6C3505C5C87}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{09ABBCAA-2DA8-4F73-A61F-EEBFC6A4C8E7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C7CA7432-0FBF-42DC-9D65-41A5AD510829}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Elasticsearch.FSharp.Tests", "tests\Elasticsearch.FSharp.Tests\Elasticsearch.FSharp.Tests.fsproj", "{0BA09266-FC24-40E8-B60C-E072EF0E08B4}"
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Elasticsearch.FSharp", "src\Elasticsearch.FSharp\Elasticsearch.FSharp.fsproj", "{3C96FF6B-EA2C-4678-A5F6-E0880267542A}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Elasticsearch.FSharp.Tests", "tests\Elasticsearch.FSharp.Tests\Elasticsearch.FSharp.Tests.fsproj", "{1AD77E98-F150-41F0-9347-766A00C85A8A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{69E3270B-8AC7-433A-83F7-D6C3505C5C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69E3270B-8AC7-433A-83F7-D6C3505C5C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69E3270B-8AC7-433A-83F7-D6C3505C5C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69E3270B-8AC7-433A-83F7-D6C3505C5C87}.Release|Any CPU.Build.0 = Release|Any CPU
{0BA09266-FC24-40E8-B60C-E072EF0E08B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0BA09266-FC24-40E8-B60C-E072EF0E08B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0BA09266-FC24-40E8-B60C-E072EF0E08B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0BA09266-FC24-40E8-B60C-E072EF0E08B4}.Release|Any CPU.Build.0 = Release|Any CPU
{3C96FF6B-EA2C-4678-A5F6-E0880267542A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C96FF6B-EA2C-4678-A5F6-E0880267542A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C96FF6B-EA2C-4678-A5F6-E0880267542A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C96FF6B-EA2C-4678-A5F6-E0880267542A}.Release|Any CPU.Build.0 = Release|Any CPU
{1AD77E98-F150-41F0-9347-766A00C85A8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AD77E98-F150-41F0-9347-766A00C85A8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AD77E98-F150-41F0-9347-766A00C85A8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AD77E98-F150-41F0-9347-766A00C85A8A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{69E3270B-8AC7-433A-83F7-D6C3505C5C87} = {09ABBCAA-2DA8-4F73-A61F-EEBFC6A4C8E7}
{0BA09266-FC24-40E8-B60C-E072EF0E08B4} = {C7CA7432-0FBF-42DC-9D65-41A5AD510829}
{3C96FF6B-EA2C-4678-A5F6-E0880267542A} = {09ABBCAA-2DA8-4F73-A61F-EEBFC6A4C8E7}
{1AD77E98-F150-41F0-9347-766A00C85A8A} = {C7CA7432-0FBF-42DC-9D65-41A5AD510829}
EndGlobalSection
EndGlobal
6 changes: 0 additions & 6 deletions packages.config

This file was deleted.

18 changes: 18 additions & 0 deletions src/Elasticsearch.FSharp/Builders/Aggs/AggBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Elasticsearch.FSharp.Builders.Aggs

type AggBuilder(name: string) =

[<CustomOperation("body")>]
member x.Body(a, t) =
a

[<CustomOperation("aggs")>]
member x.Aggs(a, b) =
a

[<CustomOperation("meta")>]
member x.Meta(a, b) =
a

member x.Yield(a) =
a
19 changes: 19 additions & 0 deletions src/Elasticsearch.FSharp/Builders/Aggs/TermsBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
namespace Elasticsearch.FSharp.Builders.Aggs

type TermsBuilder() =

[<CustomOperation("field")>]
member x.Field(a, f) =
a

[<CustomOperation("size")>]
member x.Size(a, s) =
a

[<CustomOperation("show_term_doc_count_error")>]
member x.ShowTermDocCountError(a, b:bool) =
a

member x.Yield(a) =
a

28 changes: 28 additions & 0 deletions src/Elasticsearch.FSharp/Builders/ElasticBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Elasticsearch.FSharp.Builders

open System
open Nest

type ElasticBuilder<'T when 'T: not struct>() =

let search = SearchDescriptor<'T>()

[<CustomOperation("size")>]
member x.Size(a, size: int) =
search.Size(Nullable size)

[<CustomOperation("query")>]
member x.Query(a, q: Func<QueryContainerDescriptor<'T>, QueryContainer>) =
search.Query(q)

[<CustomOperation("aggs")>]
member x.Aggs(a, aggs) =
()

[<CustomOperation("sort")>]
member x.Sort(a, sort) =
()

member x.Yield(a) =
search

37 changes: 37 additions & 0 deletions src/Elasticsearch.FSharp/Builders/Query/BoolBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
namespace Elasticsearch.FSharp.Builders.Query

open System
open Nest

type BoolBuilder<'T when 'T: not struct>() =

let calls = ResizeArray()

[<CustomOperation("must")>]
member x.Must(a, b: Func<QueryContainerDescriptor<'T>, QueryContainer> seq) =
calls.Add(fun (x:BoolQueryDescriptor<'T>) -> x.Must b)
a

[<CustomOperation("must_not")>]
member x.MustNot(a, b: Func<QueryContainerDescriptor<'T>, QueryContainer> seq) =
calls.Add(fun (x:BoolQueryDescriptor<'T>) -> x.MustNot b)
a

[<CustomOperation("should")>]
member x.Should(a, b: Func<QueryContainerDescriptor<'T>, QueryContainer> seq) =
calls.Add(fun x -> x.Should b)
a

[<CustomOperation("minimum_should_match")>]
member x.MinimumShouldMatch(a, v: string) =
calls.Add(fun x -> x.MinimumShouldMatch(MinimumShouldMatch.op_Implicit v))
a

member x.Yield(_) =
Func<_,_>(
fun (q: QueryContainerDescriptor<'T>) ->
q.Bool(
fun boolQueryDescriptor ->
Seq.fold (fun x f -> f x) boolQueryDescriptor calls :> IBoolQuery
)
)
12 changes: 12 additions & 0 deletions src/Elasticsearch.FSharp/Builders/Query/MatchAllBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Elasticsearch.FSharp.Builders.Query

open System
open Nest

type MatchAllBuilder() =

member x.Zero() =
Func<_,_>(
fun (q: QueryContainerDescriptor<'T>) ->
q.MatchAll()
)
17 changes: 17 additions & 0 deletions src/Elasticsearch.FSharp/Builders/Sort/SortByBuilder.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace Elasticsearch.FSharp.Builders.Sort

type SortByBuilder() =

[<CustomOperation("field")>]
member x.Field(a, b) =
a

[<CustomOperation("order")>]
member x.Order(a, b) =
a

[<CustomOperation("mode")>]
member x.Mode(a, b) =
a

member x.Yield(a) = a
29 changes: 0 additions & 29 deletions src/Elasticsearch.FSharp/DSL/Aggs.fs

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions src/Elasticsearch.FSharp/DSL/Queries/MatchQuery.fs

This file was deleted.

13 changes: 0 additions & 13 deletions src/Elasticsearch.FSharp/DSL/Queries/MultiMatchQuery.fs

This file was deleted.

10 changes: 0 additions & 10 deletions src/Elasticsearch.FSharp/DSL/Queries/RangeQuery.fs

This file was deleted.

4 changes: 0 additions & 4 deletions src/Elasticsearch.FSharp/DSL/Queries/ScriptQuery.fs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Elasticsearch.FSharp/DSL/Queries/TermQuery.fs

This file was deleted.

7 changes: 0 additions & 7 deletions src/Elasticsearch.FSharp/DSL/Queries/TermsQuery.fs

This file was deleted.

24 changes: 0 additions & 24 deletions src/Elasticsearch.FSharp/DSL/Query.fs

This file was deleted.

9 changes: 0 additions & 9 deletions src/Elasticsearch.FSharp/DSL/Script.fs

This file was deleted.

14 changes: 0 additions & 14 deletions src/Elasticsearch.FSharp/DSL/Search.fs

This file was deleted.

51 changes: 0 additions & 51 deletions src/Elasticsearch.FSharp/DSL/Serialization/Aggs.fs

This file was deleted.

Loading