Skip to content

Commit

Permalink
returned proper types from query building fluent interface in order t…
Browse files Browse the repository at this point in the history
…o avoid an ambiguity

git-svn-id: http://solrnet.googlecode.com/svn/trunk@309 66c3f25c-543c-0410-ae2e-6f2ca0bd8c61
  • Loading branch information
mausch committed Feb 26, 2009
1 parent 3287f38 commit cfbb840
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion SampleSolrApp/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public HomeController(ISolrReadOnlyOperations<Product> solr) {
/// <returns></returns>
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));
Expand Down
6 changes: 3 additions & 3 deletions SolrNet.DSL/Impl/FieldDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public RangeDefinition<T> From<T>(T from) {
return new RangeDefinition<T>(fieldName, from);
}

public ISolrQuery In<T>(params T[] values) {
public SolrQueryInList In<T>(params T[] values) {
return new SolrQueryInList(fieldName, Func.Select(values, v => Convert.ToString(v)));
}

public ISolrQuery Is<T>(T value) {
public SolrQueryByField Is<T>(T value) {
return new SolrQueryByField(fieldName, Convert.ToString(value));
}

public ISolrQuery HasAnyValue() {
public SolrQueryByRange<string> HasAnyValue() {
return From("*").To("*");
}
}
Expand Down
2 changes: 1 addition & 1 deletion SolrNet.DSL/Impl/RangeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public RangeDefinition(string fieldName, T from) {
this.from = from;
}

public ISolrQuery To(T to) {
public SolrQueryByRange<T> To(T to) {
return new SolrQueryByRange<T>(fieldName, from, to);
}
}
Expand Down
2 changes: 1 addition & 1 deletion SolrNet.DSL/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit cfbb840

Please sign in to comment.