From cfbb8403511be639b30394d2c1958cfe218337d0 Mon Sep 17 00:00:00 2001 From: Mauricio Scheffer Date: Thu, 26 Feb 2009 01:56:33 +0000 Subject: [PATCH] returned proper types from query building fluent interface in order to avoid an ambiguity git-svn-id: http://solrnet.googlecode.com/svn/trunk@309 66c3f25c-543c-0410-ae2e-6f2ca0bd8c61 --- SampleSolrApp/Controllers/HomeController.cs | 2 +- SolrNet.DSL/Impl/FieldDefinition.cs | 6 +++--- SolrNet.DSL/Impl/RangeDefinition.cs | 2 +- SolrNet.DSL/Query.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SampleSolrApp/Controllers/HomeController.cs b/SampleSolrApp/Controllers/HomeController.cs index 99b4c9bb4..0de4faa7e 100644 --- a/SampleSolrApp/Controllers/HomeController.cs +++ b/SampleSolrApp/Controllers/HomeController.cs @@ -39,7 +39,7 @@ public HomeController(ISolrReadOnlyOperations solr) { /// public ISolrQuery BuildQuery(SearchParameters parameters) { var queriesFromFacets = from p in parameters.Facets - select Query.Field(p.Key).Is(p.Value); + select (ISolrQuery) Query.Field(p.Key).Is(p.Value); var queries = queriesFromFacets.ToList(); if (!string.IsNullOrEmpty(parameters.FreeSearch)) queries.Add(new SolrQuery(parameters.FreeSearch)); diff --git a/SolrNet.DSL/Impl/FieldDefinition.cs b/SolrNet.DSL/Impl/FieldDefinition.cs index 23d4f65d8..4d326bbfa 100644 --- a/SolrNet.DSL/Impl/FieldDefinition.cs +++ b/SolrNet.DSL/Impl/FieldDefinition.cs @@ -29,15 +29,15 @@ public RangeDefinition From(T from) { return new RangeDefinition(fieldName, from); } - public ISolrQuery In(params T[] values) { + public SolrQueryInList In(params T[] values) { return new SolrQueryInList(fieldName, Func.Select(values, v => Convert.ToString(v))); } - public ISolrQuery Is(T value) { + public SolrQueryByField Is(T value) { return new SolrQueryByField(fieldName, Convert.ToString(value)); } - public ISolrQuery HasAnyValue() { + public SolrQueryByRange HasAnyValue() { return From("*").To("*"); } } diff --git a/SolrNet.DSL/Impl/RangeDefinition.cs b/SolrNet.DSL/Impl/RangeDefinition.cs index 5d26c02ef..9e8310284 100644 --- a/SolrNet.DSL/Impl/RangeDefinition.cs +++ b/SolrNet.DSL/Impl/RangeDefinition.cs @@ -24,7 +24,7 @@ public RangeDefinition(string fieldName, T from) { this.from = from; } - public ISolrQuery To(T to) { + public SolrQueryByRange To(T to) { return new SolrQueryByRange(fieldName, from, to); } } diff --git a/SolrNet.DSL/Query.cs b/SolrNet.DSL/Query.cs index d73f5fb3d..3ebe112ff 100644 --- a/SolrNet.DSL/Query.cs +++ b/SolrNet.DSL/Query.cs @@ -18,7 +18,7 @@ namespace SolrNet.DSL { public static class Query { - public static ISolrQuery Simple(string s) { + public static SolrQuery Simple(string s) { return new SolrQuery(s); }