mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : 1.x
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
4d1cc7eaae172f400159e64a747fac69d9608aa8 src/Orchard.Web/Modules/Orchard.Forms
|
||||
19fadd2cddbac89051c0e6fa0c8f6a2bc8d67b24 src/Orchard.Web/Modules/Orchard.Rules
|
||||
7b7a9141401137d855a5a33d1652aa51a5636bd8 src/Orchard.Web/Modules/Orchard.Tokens
|
||||
30c41b905ee07be02fe134f72c7a2449d85d71b3 src/Orchard.Web/Modules/Orchard.Forms
|
||||
bdfbf617bbd125d3e76689fba17999c76b4b8ac0 src/Orchard.Web/Modules/Orchard.Rules
|
||||
6093698fc61157076a8c26653a07e27da5280cfd src/Orchard.Web/Modules/Orchard.Tokens
|
||||
|
@@ -7,7 +7,6 @@ using NUnit.Framework;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Indexing;
|
||||
using Orchard.Indexing.Services;
|
||||
using Orchard.Tests.FileSystems.AppData;
|
||||
|
||||
namespace Orchard.Tests.Modules.Indexing {
|
||||
@@ -46,7 +45,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider = _container.Resolve<IIndexProvider>();
|
||||
}
|
||||
|
||||
private ISearchBuilder _searchBuilder { get { return _provider.CreateSearchBuilder("default"); } }
|
||||
private ISearchBuilder SearchBuilder { get { return _provider.CreateSearchBuilder("default"); } }
|
||||
|
||||
[Test]
|
||||
public void SearchTermsShouldBeFoundInMultipleFields() {
|
||||
@@ -74,9 +73,9 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(3));
|
||||
|
||||
|
||||
Assert.That(_searchBuilder.Get(1).ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.Get(2).ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.Get(3).ContentItemId, Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Get(1).ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Get(2).ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Get(3).ContentItemId, Is.EqualTo(3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -87,11 +86,93 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(3).Add("title", "cat"));
|
||||
|
||||
|
||||
Assert.That(_searchBuilder.WithField("title", "cat").Search().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("title", "cat").Search().Any(hit => new[] { 1, 3 }.Contains(hit.ContentItemId)), Is.True);
|
||||
|
||||
Assert.That(SearchBuilder.WithField("title", "cat").Search().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("title", "cat").Search().Any(hit => new[] { 1, 3 }.Contains(hit.ContentItemId)), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchByBooleanWhateverIndexingScheme() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("foo", true));
|
||||
_provider.Store("default", _provider.New(2).Add("foo", true).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("foo", true).Analyze());
|
||||
_provider.Store("default", _provider.New(4).Add("foo", true).Store().Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("foo", false));
|
||||
_provider.Store("default", _provider.New(6).Add("foo", false).Store());
|
||||
_provider.Store("default", _provider.New(7).Add("foo", false).Analyze());
|
||||
_provider.Store("default", _provider.New(8).Add("foo", false).Store().Analyze());
|
||||
|
||||
Assert.That(SearchBuilder.WithField("foo", false).Search().Count(), Is.EqualTo(4));
|
||||
Assert.That(SearchBuilder.WithField("foo", true).Search().Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchByStringWhateverIndexingScheme() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("foo", "abc"));
|
||||
_provider.Store("default", _provider.New(2).Add("foo", "abc").Store());
|
||||
_provider.Store("default", _provider.New(3).Add("foo", "abc").Analyze());
|
||||
_provider.Store("default", _provider.New(4).Add("foo", "abc").Store().Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("foo", "def"));
|
||||
_provider.Store("default", _provider.New(6).Add("foo", "def").Store());
|
||||
_provider.Store("default", _provider.New(7).Add("foo", "def").Analyze());
|
||||
_provider.Store("default", _provider.New(8).Add("foo", "def").Store().Analyze());
|
||||
|
||||
Assert.That(SearchBuilder.WithField("foo", "abc").Search().Count(), Is.EqualTo(4));
|
||||
Assert.That(SearchBuilder.WithField("foo", "def").Search().Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchByIntegerWhateverIndexingScheme() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("foo", 1));
|
||||
_provider.Store("default", _provider.New(2).Add("foo", 1).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("foo", 1).Analyze());
|
||||
_provider.Store("default", _provider.New(4).Add("foo", 1).Store().Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("foo", 2));
|
||||
_provider.Store("default", _provider.New(6).Add("foo", 2).Store());
|
||||
_provider.Store("default", _provider.New(7).Add("foo", 2).Analyze());
|
||||
_provider.Store("default", _provider.New(8).Add("foo", 2).Store().Analyze());
|
||||
|
||||
Assert.That(SearchBuilder.WithField("foo", 1).Search().Count(), Is.EqualTo(4));
|
||||
Assert.That(SearchBuilder.WithField("foo", 2).Search().Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchByFloatWhateverIndexingScheme() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("foo", 1.1));
|
||||
_provider.Store("default", _provider.New(2).Add("foo", 1.1).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("foo", 1.1).Analyze());
|
||||
_provider.Store("default", _provider.New(4).Add("foo", 1.1).Store().Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("foo", 2.1));
|
||||
_provider.Store("default", _provider.New(6).Add("foo", 2.1).Store());
|
||||
_provider.Store("default", _provider.New(7).Add("foo", 2.1).Analyze());
|
||||
_provider.Store("default", _provider.New(8).Add("foo", 2.1).Store().Analyze());
|
||||
|
||||
Assert.That(SearchBuilder.WithField("foo", 1.1).Search().Count(), Is.EqualTo(4));
|
||||
Assert.That(SearchBuilder.WithField("foo", 2.1).Search().Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSearchByDateTimeWhateverIndexingScheme() {
|
||||
var date1 = DateTime.Today;
|
||||
var date2 = DateTime.Today.AddDays(1);
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("foo", date1));
|
||||
_provider.Store("default", _provider.New(2).Add("foo", date1).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("foo", date1).Analyze());
|
||||
_provider.Store("default", _provider.New(4).Add("foo", date1).Store().Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("foo", date2));
|
||||
_provider.Store("default", _provider.New(6).Add("foo", date2).Store());
|
||||
_provider.Store("default", _provider.New(7).Add("foo", date2).Analyze());
|
||||
_provider.Store("default", _provider.New(8).Add("foo", date2).Store().Analyze());
|
||||
|
||||
Assert.That(SearchBuilder.WithField("foo", date1).Search().Count(), Is.EqualTo(4));
|
||||
Assert.That(SearchBuilder.WithField("foo", date2).Search().Count(), Is.EqualTo(4));
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void ShouldCountResultsOnly() {
|
||||
_provider.CreateIndex("default");
|
||||
@@ -99,8 +180,8 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("title", "dog"));
|
||||
_provider.Store("default", _provider.New(3).Add("title", "cat"));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("title", "dog").Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("title", "cat").Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("title", "dog").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("title", "cat").Count(), Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -110,12 +191,12 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(3).Add("date", new DateTime(2010, 05, 28, 12, 30, 45)));
|
||||
|
||||
Assert.That(_searchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), DateTime.MaxValue).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 16), new DateTime(2010, 05, 28, 12, 30, 44)).Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 46), DateTime.MaxValue).Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 1)).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), DateTime.MaxValue).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 15), new DateTime(2010, 05, 28, 12, 30, 45)).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 16), new DateTime(2010, 05, 28, 12, 30, 44)).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithinRange("date", new DateTime(2010, 05, 28, 12, 30, 46), DateTime.MaxValue).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithinRange("date", DateTime.MinValue, new DateTime(2010, 05, 28, 12, 30, 1)).Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -128,16 +209,16 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(55555));
|
||||
|
||||
|
||||
Assert.That(_searchBuilder.Count(), Is.EqualTo(5));
|
||||
Assert.That(_searchBuilder.Slice(0, 3).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Slice(1, 3).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Slice(3, 3).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Count(), Is.EqualTo(5));
|
||||
Assert.That(SearchBuilder.Slice(0, 3).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Slice(1, 3).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Slice(3, 3).Count(), Is.EqualTo(2));
|
||||
|
||||
// Count() and Search() should return the same results
|
||||
Assert.That(_searchBuilder.Search().Count(), Is.EqualTo(5));
|
||||
Assert.That(_searchBuilder.Slice(0, 3).Search().Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Slice(1, 3).Search().Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Slice(3, 3).Search().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Search().Count(), Is.EqualTo(5));
|
||||
Assert.That(SearchBuilder.Slice(0, 3).Search().Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Slice(1, 3).Search().Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Slice(3, 3).Search().Count(), Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -149,12 +230,12 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(4).Add("body", "a dog is pursuing a cat").Analyze());
|
||||
_provider.Store("default", _provider.New(5).Add("body", "the elephant can't catch up the dog").Analyze());
|
||||
|
||||
var michael = _searchBuilder.WithField("body", "michael").Search().ToList();
|
||||
var michael = SearchBuilder.WithField("body", "michael").Search().ToList();
|
||||
Assert.That(michael.Count(), Is.EqualTo(2));
|
||||
Assert.That(michael[0].Score >= michael[1].Score, Is.True);
|
||||
|
||||
// Sorting on score is always descending
|
||||
michael = _searchBuilder.WithField("body", "michael").Ascending().Search().ToList();
|
||||
michael = SearchBuilder.WithField("body", "michael").Ascending().Search().ToList();
|
||||
Assert.That(michael.Count(), Is.EqualTo(2));
|
||||
Assert.That(michael[0].Score >= michael[1].Score, Is.True);
|
||||
}
|
||||
@@ -162,37 +243,77 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
[Test]
|
||||
public void ShouldSortByDate() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 15)).Store());
|
||||
_provider.Store("default", _provider.New(2).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("date", new DateTime(2010, 05, 28, 12, 30, 45)).Store());
|
||||
_provider.Store("default", _provider.New(1).Add("date", new DateTime(2010, 05, 28, 12, 30, 30)));
|
||||
_provider.Store("default", _provider.New(2).Add("date", DateTime.MinValue));
|
||||
_provider.Store("default", _provider.New(3).Add("date", DateTime.MaxValue));
|
||||
|
||||
var date = _searchBuilder.SortByDateTime("date").Search().ToList();
|
||||
var date = SearchBuilder.SortByDateTime("date").Search().ToList();
|
||||
Assert.That(date.Count(), Is.EqualTo(3));
|
||||
Assert.That(date[0].GetDateTime("date") > date[1].GetDateTime("date"), Is.True);
|
||||
Assert.That(date[1].GetDateTime("date") > date[2].GetDateTime("date"), Is.True);
|
||||
Assert.That(date[0].ContentItemId, Is.EqualTo(3));
|
||||
Assert.That(date[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(date[2].ContentItemId, Is.EqualTo(2));
|
||||
|
||||
date = _searchBuilder.SortByDateTime("date").Ascending().Search().ToList();
|
||||
Assert.That(date.Count(), Is.EqualTo(3));
|
||||
Assert.That(date[0].GetDateTime("date") < date[1].GetDateTime("date"), Is.True);
|
||||
Assert.That(date[1].GetDateTime("date") < date[2].GetDateTime("date"), Is.True);
|
||||
date = SearchBuilder.SortByDateTime("date").Ascending().Search().ToList();
|
||||
Assert.That(date[0].ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(date[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(date[2].ContentItemId, Is.EqualTo(3));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSortByNumber() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("downloads", 111).Store());
|
||||
_provider.Store("default", _provider.New(2).Add("downloads", 2222).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("downloads", 3).Store());
|
||||
_provider.Store("default", _provider.New(1).Add("downloads", 111));
|
||||
_provider.Store("default", _provider.New(2).Add("downloads", int.MaxValue));
|
||||
_provider.Store("default", _provider.New(3).Add("downloads", int.MinValue));
|
||||
|
||||
var number = _searchBuilder.SortByInteger("downloads").Search().ToList();
|
||||
var number = SearchBuilder.SortByInteger("downloads").Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(3));
|
||||
Assert.That(number[0].GetInt("downloads") > number[1].GetInt("downloads"), Is.True);
|
||||
Assert.That(number[1].GetInt("downloads") > number[2].GetInt("downloads"), Is.True);
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(number[2].ContentItemId, Is.EqualTo(3));
|
||||
|
||||
number = _searchBuilder.SortByInteger("downloads").Ascending().Search().ToList();
|
||||
number = SearchBuilder.SortByInteger("downloads").Ascending().Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(3));
|
||||
Assert.That(number[0].GetInt("downloads") < number[1].GetInt("downloads"), Is.True);
|
||||
Assert.That(number[1].GetInt("downloads") < number[2].GetInt("downloads"), Is.True);
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(3));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(number[2].ContentItemId, Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSortByBoolean() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("active", true));
|
||||
_provider.Store("default", _provider.New(2).Add("active", false));
|
||||
|
||||
var number = SearchBuilder.SortByBoolean("active").Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(2));
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(2));
|
||||
|
||||
number = SearchBuilder.SortByBoolean("active").Ascending().Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(2));
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldSortByDouble() {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("rating", 111.111));
|
||||
_provider.Store("default", _provider.New(2).Add("rating", double.MaxValue));
|
||||
_provider.Store("default", _provider.New(3).Add("rating", double.MinValue));
|
||||
|
||||
var number = SearchBuilder.SortByDouble("rating").Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(3));
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(number[2].ContentItemId, Is.EqualTo(3));
|
||||
|
||||
number = SearchBuilder.SortByDouble("rating").Ascending().Search().ToList();
|
||||
Assert.That(number.Count(), Is.EqualTo(3));
|
||||
Assert.That(number[0].ContentItemId, Is.EqualTo(3));
|
||||
Assert.That(number[1].ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(number[2].ContentItemId, Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -201,10 +322,10 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze());
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze());
|
||||
|
||||
var cs = _searchBuilder.Parse("body", "C#").Search().ToList();
|
||||
var cs = SearchBuilder.Parse("body", "C#").Search().ToList();
|
||||
Assert.That(cs.Count(), Is.EqualTo(2));
|
||||
|
||||
var cpp = _searchBuilder.Parse("body", "C++").Search().ToList();
|
||||
var cpp = SearchBuilder.Parse("body", "C++").Search().ToList();
|
||||
Assert.That(cpp.Count(), Is.EqualTo(2));
|
||||
|
||||
}
|
||||
@@ -215,10 +336,10 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze());
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze());
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "develop").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "develop").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().ToList().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().First().ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("body", "develop").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().ToList().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("body", "develop").WithField("body", "Orchard").Mandatory().Search().First().ContentItemId, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -227,10 +348,10 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze());
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze());
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "developped").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "developped").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().ToList().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().First().ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "developped").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Search().ToList().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().ToList().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Forbidden().Search().First().ContentItemId, Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -239,7 +360,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(1).Add("body", "Orchard has been developped in C#").Analyze());
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Windows has been developped in C++").Analyze());
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "developped").WithField("body", "Orchard").Weighted(2).Search().First().ContentItemId, Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("body", "developped").WithField("body", "Orchard").Weighted(2).Search().First().ContentItemId, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -249,14 +370,14 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Renaud is also in the kitchen.").Analyze().Add("title", "A love affair").Analyze());
|
||||
_provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze());
|
||||
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "kitchen", false).Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "kitchen bertrand", false).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "kitchen +bertrand", false).Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "+kitchen +bertrand", false).Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "kit", false).Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body"}, "kit*", false).Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Search().First().ContentItemId, Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen", false).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen bertrand", false).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "kitchen +bertrand", false).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "+kitchen +bertrand", false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "kit", false).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body"}, "kit*", false).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.Parse(new[] {"body", "title"}, "bradley love^3 soap", false).Search().First().ContentItemId, Is.EqualTo(2));
|
||||
|
||||
}
|
||||
[Test]
|
||||
@@ -267,11 +388,11 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(3).Add("body", "Bertrand is a little bit jealous.").Analyze().Add("title", "Soap opera").Analyze());
|
||||
|
||||
// specifying a field to match
|
||||
Assert.That(_searchBuilder.Parse(new[] { "body" }, "title:bradley", false).Search().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.Parse(new[] { "body" }, "title:s*", false).Search().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley", false).Search().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:s*", false).Search().Count(), Is.EqualTo(1));
|
||||
|
||||
// checking terms fall back to the default fields
|
||||
Assert.That(_searchBuilder.Parse(new[] { "body" }, "title:bradley bradley", false).Search().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Parse(new[] { "body" }, "title:bradley bradley", false).Search().Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -281,13 +402,13 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("field", 22));
|
||||
_provider.Store("default", _provider.New(3).Add("field", 333));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -297,13 +418,13 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("field", 22).Store());
|
||||
_provider.Store("default", _provider.New(3).Add("field", 333).Store());
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 1).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 22).ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field", 333).ExactMatch().Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 0).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 2).ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field", 3).ExactMatch().Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -324,21 +445,21 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(2).Add("body", "Windows a été développé par Microsoft en C++").Analyze().Add("culture", 1036));
|
||||
_provider.Store("default", _provider.New(3).Add("title", "Home").Analyze().Add("culture", 1033));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "Microsoft").Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("body", "Microsoft").Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithField("body", "Microsoft").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "Orchard").WithField("culture", 1036).AsFilter().Count(), Is.EqualTo(0));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("culture", 1033).Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("culture", 1033).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(2));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("body", "blabla").WithField("culture", 1033).Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("body", "blabla").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("body", "blabla").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(0));
|
||||
|
||||
Assert.That(_searchBuilder.Parse("title", "home").Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.Parse("title", "home").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Parse("title", "home").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.Parse("title", "home").WithField("culture", 1033).AsFilter().Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -346,7 +467,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.CreateIndex("default");
|
||||
_provider.Store("default", _provider.New(1).Add("body", "foo.bar").Analyze());
|
||||
|
||||
Assert.That(_searchBuilder.Parse("body", "*@!woo*@!").Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.Parse("body", "*@!woo*@!").Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -362,17 +483,17 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
|
||||
_provider.Store("default", documentIndex);
|
||||
|
||||
Assert.That(_searchBuilder.WithField("tag-id", 0).Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("tag-id", 1).Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-id", 2).Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-id", 3).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-id", 0).Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("tag-id", 1).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-id", 2).Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-id", 3).Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag").ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag2").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag3").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag").ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag2").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag3").ExactMatch().Count(), Is.EqualTo(1));
|
||||
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -385,12 +506,12 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", documentIndex);
|
||||
|
||||
// trying in prefix mode
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "Tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "Tag").Count(), Is.EqualTo(1));
|
||||
|
||||
// trying in full word match mode
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-value", "Tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-value", "Tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -404,12 +525,12 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", documentIndex);
|
||||
|
||||
// a value which is not analyzed, is not lowered cased in the index
|
||||
Assert.That(_searchBuilder.WithField("tag-valueL", "tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-valueU", "tag").Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("tag-valueL", "Tag").Count(), Is.EqualTo(1)); // queried term is lower cased
|
||||
Assert.That(_searchBuilder.WithField("tag-valueU", "Tag").Count(), Is.EqualTo(0)); // queried term is lower cased
|
||||
Assert.That(_searchBuilder.WithField("tag-valueL", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(_searchBuilder.WithField("tag-valueU", "tag1").ExactMatch().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("tag-valueL", "tag").Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-valueU", "tag").Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("tag-valueL", "Tag").Count(), Is.EqualTo(1)); // queried term is lower cased
|
||||
Assert.That(SearchBuilder.WithField("tag-valueU", "Tag").Count(), Is.EqualTo(0)); // queried term is lower cased
|
||||
Assert.That(SearchBuilder.WithField("tag-valueL", "tag1").ExactMatch().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("tag-valueU", "tag1").ExactMatch().Count(), Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -419,7 +540,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(i).Add("term-id", i).Store());
|
||||
}
|
||||
|
||||
Assert.That(_searchBuilder.Count(), Is.EqualTo(99));
|
||||
Assert.That(SearchBuilder.Count(), Is.EqualTo(99));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -429,12 +550,12 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_provider.Store("default", _provider.New(i).Add("term-id", i / 10).Store());
|
||||
}
|
||||
|
||||
Assert.That(_searchBuilder.Count(), Is.EqualTo(49));
|
||||
Assert.That(_searchBuilder.WithField("term-id", 0).ExactMatch().AsFilter().Count(), Is.EqualTo(9));
|
||||
Assert.That(_searchBuilder.WithField("term-id", 1).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(_searchBuilder.WithField("term-id", 2).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(_searchBuilder.WithField("term-id", 3).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(_searchBuilder.WithField("term-id", 4).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(SearchBuilder.Count(), Is.EqualTo(49));
|
||||
Assert.That(SearchBuilder.WithField("term-id", 0).ExactMatch().AsFilter().Count(), Is.EqualTo(9));
|
||||
Assert.That(SearchBuilder.WithField("term-id", 1).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(SearchBuilder.WithField("term-id", 2).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(SearchBuilder.WithField("term-id", 3).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
Assert.That(SearchBuilder.WithField("term-id", 4).ExactMatch().AsFilter().Count(), Is.EqualTo(10));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -462,10 +583,10 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
);
|
||||
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field1", 0).Mandatory().Count(), Is.EqualTo(0));
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).Mandatory().Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().WithField("field3", 3).Mandatory().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field1", 0).Mandatory().Count(), Is.EqualTo(0));
|
||||
Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().Count(), Is.EqualTo(3));
|
||||
Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().Count(), Is.EqualTo(2));
|
||||
Assert.That(SearchBuilder.WithField("field1", 1).Mandatory().WithField("field2", 2).Mandatory().WithField("field3", 3).Mandatory().Count(), Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -492,9 +613,18 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
.Add("field3", 3)
|
||||
);
|
||||
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).Count(), Is.EqualTo(3));
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).WithField("field2", 2).AsFilter().Count(), Is.EqualTo(2));
|
||||
Assert.That(_searchBuilder.WithField("field1", 1).WithField("field2", 2).Mandatory().AsFilter().WithField("field3", 3).Mandatory().AsFilter().Count(), Is.EqualTo(1));
|
||||
Assert.That(SearchBuilder.WithField("field1", 1).Count(), Is.EqualTo(3));
|
||||
|
||||
Assert.That(SearchBuilder
|
||||
.WithField("field1", 1)
|
||||
.WithField("field2", 2).AsFilter()
|
||||
.Count(), Is.EqualTo(2));
|
||||
|
||||
Assert.That(SearchBuilder
|
||||
.WithField("field1", 1)
|
||||
.WithField("field2", 2).Mandatory().AsFilter()
|
||||
.WithField("field3", 3).Mandatory().AsFilter()
|
||||
.Count(), Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
48
src/Orchard.Web/Core/Contents/Handlers/RulesHandler.cs
Normal file
48
src/Orchard.Web/Core/Contents/Handlers/RulesHandler.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Events;
|
||||
|
||||
namespace Orchard.Core.Contents.Handlers {
|
||||
|
||||
public interface IRulesManager : IEventHandler
|
||||
{
|
||||
void TriggerEvent(string category, string type, Func<Dictionary<string, object>> tokensContext);
|
||||
}
|
||||
|
||||
[OrchardFeature("Orchard.Core.Contents.Rules")]
|
||||
public class RulePartHandler : ContentHandler
|
||||
{
|
||||
public RulePartHandler(IRulesManager rulesManager)
|
||||
{
|
||||
|
||||
OnPublished<ContentPart>(
|
||||
(context, part) =>
|
||||
rulesManager.TriggerEvent("Content", "Published",
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
|
||||
|
||||
OnPublished<ContentPart>(
|
||||
(context, part) =>
|
||||
rulesManager.TriggerEvent("Content", "Published",
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } } ));
|
||||
|
||||
OnRemoved<ContentPart>(
|
||||
(context, part) =>
|
||||
rulesManager.TriggerEvent("Content", "Removed",
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
|
||||
|
||||
OnVersioned<ContentPart>(
|
||||
(context, part1, part2) =>
|
||||
rulesManager.TriggerEvent("Content", "Versioned",
|
||||
() => new Dictionary<string, object> { { "Content", part1.ContentItem } }));
|
||||
|
||||
OnCreated<ContentPart>(
|
||||
(context, part) =>
|
||||
rulesManager.TriggerEvent("Content", "Created",
|
||||
() => new Dictionary<string, object> { { "Content", context.ContentItem } }));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -5,5 +5,13 @@ Website: http://orchardproject.net
|
||||
Version: 1.2.0
|
||||
OrchardVersion: 1.2.0
|
||||
Description: The contents module enables the creation of custom content types.
|
||||
FeatureDescription: Default custom content type definition, creation and management.
|
||||
Category: Core
|
||||
Features:
|
||||
Contents
|
||||
Name: Contents
|
||||
Description: Default custom content type definition, creation and management.
|
||||
Category: Core
|
||||
Contents.Rules:
|
||||
Name: Contents Rules
|
||||
Description: Rules for the Contents modules
|
||||
Category: Rules
|
||||
Dependency: Rules
|
||||
|
64
src/Orchard.Web/Core/Contents/Rules/ContentEvents.cs
Normal file
64
src/Orchard.Web/Core/Contents/Rules/ContentEvents.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Events;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Core.Contents.Rules
|
||||
{
|
||||
public interface IEventProvider : IEventHandler
|
||||
{
|
||||
void Describe(dynamic describe);
|
||||
}
|
||||
|
||||
[OrchardFeature("Contents.Rules")]
|
||||
public class ContentEvents : IEventProvider
|
||||
{
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public void Describe(dynamic describe)
|
||||
{
|
||||
Func<dynamic, bool> contentHasPart = ContentHasPart;
|
||||
|
||||
describe.For("Content", T("Content Items"), T("Content Items"))
|
||||
.Element("Created", T("Content Created"), T("Content is actually created."), contentHasPart, (Func<dynamic, LocalizedString>) (context => T("When content with types ({0}) is created.", FormatPartsList(context))), "SelectContentTypes")
|
||||
.Element("Versioned", T("Content Versioned"), T("Content is actually versioned."), contentHasPart, (Func<dynamic, LocalizedString>) (context => T("When content with types ({0}) is versioned.", FormatPartsList(context))), "SelectContentTypes")
|
||||
.Element("Published", T("Content Published"), T("Content is actually published."), contentHasPart, (Func<dynamic, LocalizedString>) (context => T("When content with types ({0}) is published.", FormatPartsList(context))), "SelectContentTypes")
|
||||
.Element("Removed", T("Content Removed"), T("Content is actually removed."), contentHasPart, (Func<dynamic, LocalizedString>) (context => T("When content with types ({0}) is removed.", FormatPartsList(context))), "SelectContentTypes");
|
||||
}
|
||||
|
||||
private string FormatPartsList(dynamic context)
|
||||
{
|
||||
var contenttypes = context.Properties["contenttypes"];
|
||||
|
||||
if(String.IsNullOrEmpty(contenttypes))
|
||||
{
|
||||
return T("Any").Text;
|
||||
}
|
||||
|
||||
return contenttypes;
|
||||
}
|
||||
|
||||
private static bool ContentHasPart(dynamic context)
|
||||
{
|
||||
string contenttypes = context.Properties["contenttypes"];
|
||||
var content = context.Tokens["Content"] as IContent;
|
||||
|
||||
// "" means 'any'
|
||||
if(String.IsNullOrEmpty(contenttypes))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(content == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var contentTypes = contenttypes.Split(new [] {','} );
|
||||
|
||||
return contentTypes.Any(contentType => content.ContentItem.TypeDefinition.Name == contentType);
|
||||
}
|
||||
}
|
||||
}
|
61
src/Orchard.Web/Core/Contents/Rules/ContentForms.cs
Normal file
61
src/Orchard.Web/Core/Contents/Rules/ContentForms.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Events;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Core.Contents.Rules
|
||||
{
|
||||
public interface IFormProvider : IEventHandler
|
||||
{
|
||||
void Describe(dynamic context);
|
||||
}
|
||||
|
||||
[OrchardFeature("Contents.Rules")]
|
||||
public class ContentForms : IFormProvider
|
||||
{
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
protected dynamic Shape { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public ContentForms(
|
||||
IShapeFactory shapeFactory,
|
||||
IContentDefinitionManager contentDefinitionManager)
|
||||
{
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
Shape = shapeFactory;
|
||||
}
|
||||
|
||||
public void Describe(dynamic context)
|
||||
{
|
||||
Func<IShapeFactory, dynamic> form =
|
||||
shape => {
|
||||
|
||||
var f = Shape.Form(
|
||||
Id: "AnyOfContentTypes",
|
||||
_Parts: Shape.SelectList(
|
||||
Id: "contenttypes", Name: "contenttypes",
|
||||
Title: T("Content types"),
|
||||
Description: T("Select some content types."),
|
||||
Size: 10,
|
||||
Multiple: true
|
||||
)
|
||||
);
|
||||
|
||||
f._Parts.Add(new SelectListItem { Value = "", Text = T("Any").Text });
|
||||
|
||||
foreach (var contentType in _contentDefinitionManager.ListTypeDefinitions())
|
||||
{
|
||||
f._Parts.Add(new SelectListItem { Value = contentType.Name, Text = contentType.DisplayName });
|
||||
}
|
||||
|
||||
return f;
|
||||
};
|
||||
|
||||
context.Form("SelectContentTypes", form);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -103,6 +103,9 @@
|
||||
<Compile Include="Containers\ViewModels\ContainableViewModel.cs" />
|
||||
<Compile Include="Containers\ViewModels\ContainerWidgetViewModel.cs" />
|
||||
<Compile Include="Containers\ViewModels\ContainerViewModel.cs" />
|
||||
<Compile Include="Contents\Handlers\RulesHandler.cs" />
|
||||
<Compile Include="Contents\Rules\ContentEvents.cs" />
|
||||
<Compile Include="Contents\Rules\ContentForms.cs" />
|
||||
<Compile Include="Contents\Security\AuthorizationEventHandler.cs" />
|
||||
<Compile Include="Common\Services\BbcodeFilter.cs" />
|
||||
<Compile Include="Common\Services\ICommonService.cs" />
|
||||
|
@@ -59,7 +59,7 @@ namespace Lucene.Models {
|
||||
}
|
||||
|
||||
public IDocumentIndex Add(string name, bool value) {
|
||||
return Add(name, value.ToString());
|
||||
return Add(name, value ? 1 : 0);
|
||||
}
|
||||
|
||||
public IDocumentIndex Add(string name, double value) {
|
||||
|
@@ -29,8 +29,7 @@ namespace Lucene.Models {
|
||||
}
|
||||
|
||||
public bool GetBoolean(string name) {
|
||||
var field = _doc.GetField(name);
|
||||
return field == null ? false : bool.Parse(field.StringValue());
|
||||
return GetInt(name) > 0 ? true : false;
|
||||
}
|
||||
|
||||
public string GetString(string name) {
|
||||
|
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Lucene.Models;
|
||||
using Lucene.Net.Index;
|
||||
@@ -89,22 +88,20 @@ namespace Lucene.Services {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithField(string field, float value) {
|
||||
public ISearchBuilder WithField(string field, double value) {
|
||||
CreatePendingClause();
|
||||
_query = NumericRangeQuery.NewFloatRange(field, value, value, true, true);
|
||||
_query = NumericRangeQuery.NewDoubleRange(field, value, value, true, true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, float min, float max) {
|
||||
public ISearchBuilder WithinRange(string field, double min, double max) {
|
||||
CreatePendingClause();
|
||||
_query = NumericRangeQuery.NewFloatRange(field, min, max, true, true);
|
||||
_query = NumericRangeQuery.NewDoubleRange(field, min, max, true, true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithField(string field, bool value) {
|
||||
CreatePendingClause();
|
||||
_query = new TermQuery(new Term(field, value.ToString().ToLower()));
|
||||
return this;
|
||||
return WithField(field, value ? 1 : 0);
|
||||
}
|
||||
|
||||
public ISearchBuilder WithField(string field, DateTime value) {
|
||||
@@ -203,15 +200,19 @@ namespace Lucene.Services {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByBoolean(string name) {
|
||||
return SortByInteger(name);
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByString(string name) {
|
||||
_sort = name;
|
||||
_comparer = SortField.STRING;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByFloat(string name) {
|
||||
public ISearchBuilder SortByDouble(string name) {
|
||||
_sort = name;
|
||||
_comparer = SortField.FLOAT;
|
||||
_comparer = SortField.DOUBLE;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@@ -6,13 +6,13 @@ Version: 1.2.0
|
||||
OrchardVersion: 1.2.0
|
||||
Description: The comments system implemented by this module can be applied to arbitrary Orchard content types, such as blogs and pages. It includes comment validation and spam protection through the Akismet service.
|
||||
Features:
|
||||
Orchard.Comments:
|
||||
Name: Comments
|
||||
Description: Standard content item comments.
|
||||
Dependencies: Settings
|
||||
Category: Social
|
||||
Orchard.Comments.Rules:
|
||||
Name: Comments Rules
|
||||
Description: Rules for the Comments modules
|
||||
Dependencies: Orchard.Rules, Orchard.Forms
|
||||
Category: Rules
|
||||
Orchard.Comments:
|
||||
Name: Comments
|
||||
Description: Standard content item comments.
|
||||
Dependencies: Settings
|
||||
Category: Social
|
||||
Orchard.Comments.Rules:
|
||||
Name: Comments Rules
|
||||
Description: Rules for the Comments modules
|
||||
Category: Rules
|
||||
Dependency: Rules
|
@@ -117,14 +117,6 @@
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Forms\Orchard.Forms.csproj">
|
||||
<Project>{642A49D7-8752-4177-80D6-BFBBCFAD3DE0}</Project>
|
||||
<Name>Orchard.Forms</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Orchard.Rules\Orchard.Rules.csproj">
|
||||
<Project>{966EC390-3C7F-4D98-92A6-F0F30D02E9B1}</Project>
|
||||
<Name>Orchard.Rules</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Admin\Edit.cshtml" />
|
||||
|
@@ -32,3 +32,4 @@ using System.Security;
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.2.0")]
|
||||
[assembly: AssemblyFileVersion("1.2.0")]
|
||||
[assembly:SecurityTransparent]
|
@@ -1,13 +1,17 @@
|
||||
using System;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Rules.Models;
|
||||
using Orchard.Rules.Services;
|
||||
using Orchard.Events;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Comments.Rules
|
||||
{
|
||||
public interface IActionProvider : IEventHandler
|
||||
{
|
||||
void Describe(dynamic describe);
|
||||
}
|
||||
|
||||
[OrchardFeature("Orchard.Comments.Rules")]
|
||||
public class CommentsActions : IActionProvider
|
||||
{
|
||||
@@ -20,13 +24,18 @@ namespace Orchard.Comments.Rules
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public void Describe(DescribeActionContext context)
|
||||
public void Describe(dynamic describe)
|
||||
{
|
||||
context.For("Comments", T("Comments"), T("Comments"))
|
||||
.Element("Close", T("Close Comments"), T("Closes comments on a content item."), Close, actionContext => T("Close comments"), "ActionCloseComments");
|
||||
Func<dynamic, LocalizedString> display = context => T("Close comments");
|
||||
|
||||
describe.For("Comments", T("Comments"), T("Comments"))
|
||||
.Element("Close", T("Close Comments"), T("Closes comments on a content item."), (Action<dynamic>) Close, display, "ActionCloseComments");
|
||||
}
|
||||
|
||||
private void Close(ActionContext context)
|
||||
/// <summary>
|
||||
/// Closes the comments on the content represented by "ContentId"
|
||||
/// </summary>
|
||||
private void Close(dynamic context)
|
||||
{
|
||||
var contentId = Convert.ToInt32(context.Properties["ContentId"]);
|
||||
var content = _contentManager.Get(contentId);
|
||||
|
@@ -1,10 +1,16 @@
|
||||
using Orchard.DisplayManagement;
|
||||
using System;
|
||||
using Orchard.DisplayManagement;
|
||||
using Orchard.Environment.Extensions;
|
||||
using Orchard.Forms.Services;
|
||||
using Orchard.Events;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace Orchard.Comments.Rules
|
||||
{
|
||||
public interface IFormProvider : IEventHandler
|
||||
{
|
||||
void Describe(dynamic context);
|
||||
}
|
||||
|
||||
[OrchardFeature("Orchard.Comments.Rules")]
|
||||
public class CommentsForms : IFormProvider
|
||||
{
|
||||
@@ -16,17 +22,19 @@ namespace Orchard.Comments.Rules
|
||||
Shape = shapeFactory;
|
||||
}
|
||||
|
||||
public void Describe(DescribeContext context)
|
||||
public void Describe(dynamic context)
|
||||
{
|
||||
context.Form("ActionCloseComments",
|
||||
|
||||
Func<IShapeFactory, dynamic> form =
|
||||
shape => Shape.Form(
|
||||
Id: "ActionCloseComments",
|
||||
_Type: Shape.Textbox(
|
||||
Id: "ContentId", Name: "ContentId",
|
||||
Title: T("Content Item Id"),
|
||||
Description: T("Content Item Id."))
|
||||
)
|
||||
);
|
||||
Id: "ActionCloseComments",
|
||||
_Type: Shape.Textbox(
|
||||
Id: "ContentId", Name: "ContentId",
|
||||
Title: T("Content Item Id"),
|
||||
Description: T("Content Item Id."))
|
||||
);
|
||||
|
||||
context.Form("ActionCloseComments", form);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,7 +1,12 @@
|
||||
using Orchard.Data.Conventions;
|
||||
|
||||
namespace Orchard.Tags.Models {
|
||||
public class ContentTagRecord {
|
||||
public virtual int Id { get; set; }
|
||||
|
||||
[Aggregate]
|
||||
public virtual TagRecord TagRecord { get; set; }
|
||||
|
||||
public virtual TagsPartRecord TagsPartRecord { get; set; }
|
||||
}
|
||||
}
|
@@ -1,11 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Data.Conventions;
|
||||
|
||||
namespace Orchard.Tags.Models {
|
||||
public class TagsPartRecord : ContentPartRecord {
|
||||
public TagsPartRecord() {
|
||||
Tags = new List<ContentTagRecord>();
|
||||
}
|
||||
|
||||
[Aggregate]
|
||||
public virtual IList<ContentTagRecord> Tags { get; set; }
|
||||
}
|
||||
}
|
@@ -43,7 +43,6 @@ table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
/* Remember focus styles! */
|
||||
:focus { outline: 0; }
|
||||
|
||||
body { line-height: 1; color: black; background: white; }
|
||||
ol, ul { list-style: none; }
|
||||
|
||||
/* Tables still need 'cellspacing="0"' in the markup */
|
||||
@@ -110,7 +109,8 @@ Pixels EMs Percent Points
|
||||
24px 1.846em 184.6% 18pt
|
||||
*/
|
||||
|
||||
body {
|
||||
body {
|
||||
line-height: 1;
|
||||
font-size: 81.3%;
|
||||
color: #434343;
|
||||
background: #fff;
|
||||
|
40
src/Orchard/Data/Conventions/AggregateAttribute.cs
Normal file
40
src/Orchard/Data/Conventions/AggregateAttribute.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using FluentNHibernate.Conventions;
|
||||
using FluentNHibernate.Conventions.AcceptanceCriteria;
|
||||
using FluentNHibernate.Conventions.Inspections;
|
||||
using FluentNHibernate.Conventions.Instances;
|
||||
|
||||
namespace Orchard.Data.Conventions
|
||||
{
|
||||
/// <summary>
|
||||
/// This attribute is used to mark relationships which need to be eagerly fetched with the parent object,
|
||||
/// thus defining an aggregate in terms of DDD
|
||||
/// </summary>
|
||||
public class AggregateAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class ReferenceConvention : IReferenceConvention, IReferenceConventionAcceptance, IHasManyConvention, IHasManyConventionAcceptance
|
||||
{
|
||||
public void Apply(IManyToOneInstance instance)
|
||||
{
|
||||
instance.Fetch.Join();
|
||||
}
|
||||
|
||||
public void Accept(IAcceptanceCriteria<IManyToOneInspector> criteria)
|
||||
{
|
||||
criteria.Expect(x => x.Property != null && x.Property.IsDefined(typeof(AggregateAttribute), false));
|
||||
}
|
||||
|
||||
public void Apply(IOneToManyCollectionInstance instance)
|
||||
{
|
||||
instance.Fetch.Join();
|
||||
}
|
||||
|
||||
public void Accept(IAcceptanceCriteria<IOneToManyCollectionInspector> criteria)
|
||||
{
|
||||
criteria.Expect(x => x.Member != null && x.Member.IsDefined(typeof(AggregateAttribute), false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -10,9 +10,9 @@ namespace Orchard.Indexing {
|
||||
ISearchBuilder WithField(string field, DateTime value);
|
||||
ISearchBuilder WithField(string field, string value);
|
||||
ISearchBuilder WithField(string field, int value);
|
||||
ISearchBuilder WithField(string field, float value);
|
||||
ISearchBuilder WithField(string field, double value);
|
||||
ISearchBuilder WithinRange(string field, int min, int max);
|
||||
ISearchBuilder WithinRange(string field, float min, float max);
|
||||
ISearchBuilder WithinRange(string field, double min, double max);
|
||||
ISearchBuilder WithinRange(string field, DateTime min, DateTime max);
|
||||
ISearchBuilder WithinRange(string field, string min, string max);
|
||||
|
||||
@@ -48,8 +48,9 @@ namespace Orchard.Indexing {
|
||||
|
||||
ISearchBuilder SortBy(string name);
|
||||
ISearchBuilder SortByInteger(string name);
|
||||
ISearchBuilder SortByBoolean(string name);
|
||||
ISearchBuilder SortByString(string name);
|
||||
ISearchBuilder SortByFloat(string name);
|
||||
ISearchBuilder SortByDouble(string name);
|
||||
ISearchBuilder SortByDateTime(string name);
|
||||
ISearchBuilder Ascending();
|
||||
|
||||
|
@@ -28,7 +28,7 @@ namespace Orchard.Indexing {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithField(string field, float value) {
|
||||
public ISearchBuilder WithField(string field, double value) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Orchard.Indexing {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder WithinRange(string field, float min, float max) {
|
||||
public ISearchBuilder WithinRange(string field, double min, double max) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -96,11 +96,15 @@ namespace Orchard.Indexing {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByBoolean(string name) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByString(string name) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ISearchBuilder SortByFloat(string name) {
|
||||
public ISearchBuilder SortByDouble(string name) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@@ -177,6 +177,7 @@
|
||||
<Compile Include="ContentManagement\ImportContentSession.cs" />
|
||||
<Compile Include="ContentManagement\QueryHints.cs" />
|
||||
<Compile Include="ContentManagement\Utilities\ComputedField.cs" />
|
||||
<Compile Include="Data\Conventions\AggregateAttribute.cs" />
|
||||
<Compile Include="DisplayManagement\Descriptors\PlacementInfo.cs" />
|
||||
<Compile Include="DisplayManagement\Descriptors\ResourceBindingStrategy\StylesheetBindingStrategy.cs" />
|
||||
<Compile Include="DisplayManagement\Descriptors\ShapeDescriptor.cs" />
|
||||
|
Reference in New Issue
Block a user