Permalink
Browse files

RDoc-97. Documents Highlights feature.

  • Loading branch information...
1 parent 3782cb5 commit eb041a8420c519c700f5e4fec00fdea8ef83549d @ppekrol ppekrol committed Mar 12, 2013
Showing with 190,804 additions and 184 deletions.
  1. +1 −0 version_2_5/code-samples/ClientApi/BasicOperations/SavingNewDocument.cs
  2. +97 −1 version_2_5/code-samples/ClientApi/Querying/StaticIndexes/Searching.cs
  3. +1 −0 version_2_5/code-samples/ClientApi/WorkingAsynchronously.cs
  4. +8 −8 version_2_5/code-samples/RavenCodeSamples.csproj
  5. +3 −1 version_2_5/code-samples/Samples/WebApi/CreateAspNetWebApiProject.cs
  6. +2 −2 version_2_5/code-samples/Server/Extending/Bundles/PeriodicBackups.cs
  7. +7 −7 version_2_5/code-samples/packages.config
  8. +37 −1 version_2_5/docs/client-api/querying/static-indexes/searching.markdown
  9. BIN version_2_5/packages/Other/Raven.Client.Lightweight.dll
  10. BIN ...ackages/RavenDB.Bundles.IndexReplication.2.0.2230/RavenDB.Bundles.IndexReplication.2.0.2230.nupkg
  11. BIN ...ndles.IndexReplication.2.0.2288-Unstable/RavenDB.Bundles.IndexReplication.2.0.2288-Unstable.nupkg
  12. +3 −3 ...les.IndexReplication.2.0.2288-Unstable/RavenDB.Bundles.IndexReplication.2.0.2288-Unstable.nuspec}
  13. BIN ... RavenDB.Bundles.IndexReplication.2.0.2288-Unstable}/lib/net40/Raven.Bundles.IndexReplication.dll
  14. BIN ... RavenDB.Bundles.IndexReplication.2.0.2288-Unstable}/lib/net40/Raven.Bundles.IndexReplication.pdb
  15. BIN version_2_5/packages/RavenDB.Client.2.0.2230/RavenDB.Client.2.0.2230.nupkg
  16. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/net40/Raven.Abstractions.dll
  17. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/net40/Raven.Abstractions.pdb
  18. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/net40/Raven.Client.Lightweight.dll
  19. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/net40/Raven.Client.Lightweight.pdb
  20. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/sl40/Raven.Client.Silverlight-4.dll
  21. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/sl40/Raven.Client.Silverlight-4.pdb
  22. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/sl50/Raven.Client.Silverlight.dll
  23. BIN version_2_5/packages/RavenDB.Client.2.0.2230/lib/sl50/Raven.Client.Silverlight.pdb
  24. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/RavenDB.Client.2.0.2288-Unstable.nupkg
  25. +2 −2 ...lient.2.0.2230.nuspec → RavenDB.Client.2.0.2288-Unstable/RavenDB.Client.2.0.2288-Unstable.nuspec}
  26. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/net40/Raven.Abstractions.dll
  27. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/net40/Raven.Abstractions.pdb
  28. +137 −4 ...ges/{RavenDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/net40/Raven.Abstractions.xml
  29. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/net40/Raven.Client.Lightweight.dll
  30. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/net40/Raven.Client.Lightweight.pdb
  31. +435 −73 ...avenDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/net40/Raven.Client.Lightweight.xml
  32. BIN ...enDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/sl40/AsyncCtpLibrary_Silverlight.dll
  33. 0 ...enDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/sl40/AsyncCtpLibrary_Silverlight.xml
  34. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/sl40/Raven.Client.Silverlight-4.dll
  35. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/sl40/Raven.Client.Silverlight-4.pdb
  36. BIN ...nDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/sl50/AsyncCtpLibrary_Silverlight5.dll
  37. 0 ...nDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/sl50/AsyncCtpLibrary_Silverlight5.xml
  38. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/sl50/Raven.Client.Silverlight.dll
  39. BIN version_2_5/packages/RavenDB.Client.2.0.2288-Unstable/lib/sl50/Raven.Client.Silverlight.pdb
  40. +517 −57 ...RavenDB.Client.2.0.2230 → RavenDB.Client.2.0.2288-Unstable}/lib/sl50/Raven.Client.Silverlight.xml
  41. BIN ...on_2_5/packages/RavenDB.Client.Authorization.2.0.2230/RavenDB.Client.Authorization.2.0.2230.nupkg
  42. BIN ...venDB.Client.Authorization.2.0.2288-Unstable/RavenDB.Client.Authorization.2.0.2288-Unstable.nupkg
  43. +2 −2 ...nDB.Client.Authorization.2.0.2288-Unstable/RavenDB.Client.Authorization.2.0.2288-Unstable.nuspec}
  44. BIN ...0.2230 → RavenDB.Client.Authorization.2.0.2288-Unstable}/lib/net40/Raven.Client.Authorization.dll
  45. BIN ...0.2230 → RavenDB.Client.Authorization.2.0.2288-Unstable}/lib/net40/Raven.Client.Authorization.pdb
  46. BIN ..._2_5/packages/RavenDB.Client.MvcIntegration.2.0.2230/RavenDB.Client.MvcIntegration.2.0.2230.nupkg
  47. BIN ...nDB.Client.MvcIntegration.2.0.2288-Unstable/RavenDB.Client.MvcIntegration.2.0.2288-Unstable.nupkg
  48. +3 −3 ...B.Client.MvcIntegration.2.0.2288-Unstable/RavenDB.Client.MvcIntegration.2.0.2288-Unstable.nuspec}
  49. BIN ...2230 → RavenDB.Client.MvcIntegration.2.0.2288-Unstable}/lib/net40/Raven.Client.MvcIntegration.dll
  50. BIN ...2230 → RavenDB.Client.MvcIntegration.2.0.2288-Unstable}/lib/net40/Raven.Client.MvcIntegration.pdb
  51. BIN ...ackages/RavenDB.Client.UniqueConstraints.2.0.2230/RavenDB.Client.UniqueConstraints.2.0.2230.nupkg
  52. BIN ...5/packages/RavenDB.Client.UniqueConstraints.2.0.2230/lib/net40/Raven.Client.UniqueConstraints.pdb
  53. BIN ...ient.UniqueConstraints.2.0.2288-Unstable/RavenDB.Client.UniqueConstraints.2.0.2288-Unstable.nupkg
  54. +3 −3 ...nt.UniqueConstraints.2.0.2288-Unstable/RavenDB.Client.UniqueConstraints.2.0.2288-Unstable.nuspec}
  55. BIN ... RavenDB.Client.UniqueConstraints.2.0.2288-Unstable}/lib/net40/Raven.Client.UniqueConstraints.dll
  56. BIN ...s/RavenDB.Client.UniqueConstraints.2.0.2288-Unstable/lib/net40/Raven.Client.UniqueConstraints.pdb
  57. BIN version_2_5/packages/RavenDB.Database.2.0.2230/lib/net40/Lucene.Net.Contrib.Spatial.NTS.dll
  58. BIN version_2_5/packages/RavenDB.Database.2.0.2230/lib/net40/Lucene.Net.Contrib.Spatial.NTS.pdb
  59. BIN version_2_5/packages/RavenDB.Database.2.0.2230/lib/net40/Raven.Abstractions.dll
  60. BIN version_2_5/packages/RavenDB.Database.2.0.2230/lib/net40/Raven.Abstractions.pdb
  61. BIN version_2_5/packages/RavenDB.Database.2.0.2230/lib/net40/Raven.Database.pdb
  62. BIN ...ase.2.0.2230.nupkg → RavenDB.Database.2.0.2288-Unstable/RavenDB.Database.2.0.2288-Unstable.nupkg}
  63. +2 −2 ...e.2.0.2230.nuspec → RavenDB.Database.2.0.2288-Unstable/RavenDB.Database.2.0.2288-Unstable.nuspec}
  64. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/AWS.Extensions.dll
  65. +242 −0 version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/AWS.Extensions.xml
  66. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/AWSSDK.dll
  67. +189,147 −0 version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/AWSSDK.xml
  68. BIN ...ages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Esent.Interop.dll
  69. BIN ...ages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Esent.Interop.pdb
  70. 0 ...ages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Esent.Interop.xml
  71. BIN ..._5/packages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/GeoAPI.dll
  72. BIN ...tabase.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/ICSharpCode.NRefactory.CSharp.dll
  73. 0 ...tabase.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/ICSharpCode.NRefactory.CSharp.xml
  74. BIN ...enDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/ICSharpCode.NRefactory.dll
  75. 0 ...enDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/ICSharpCode.NRefactory.xml
  76. BIN ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Jint.Raven.dll
  77. BIN ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Jint.Raven.pdb
  78. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/Lucene.Net.Contrib.Spatial.NTS.dll
  79. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/Lucene.Net.Contrib.Spatial.NTS.pdb
  80. 0 ...abase.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Lucene.Net.Contrib.Spatial.NTS.xml
  81. BIN ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Lucene.Net.dll
  82. BIN ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Lucene.Net.pdb
  83. 0 ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Lucene.Net.xml
  84. BIN ...ackages/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Mono.Cecil.dll
  85. BIN ...s/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/NetTopologySuite.dll
  86. BIN ...s/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/PowerCollections.dll
  87. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/Raven.Abstractions.dll
  88. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/Raven.Abstractions.pdb
  89. +137 −4 ...{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Raven.Abstractions.xml
  90. BIN ...ges/{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Raven.Database.dll
  91. BIN version_2_5/packages/RavenDB.Database.2.0.2288-Unstable/lib/net40/Raven.Database.pdb
  92. BIN ...{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Spatial4n.Core.NTS.dll
  93. BIN ...{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Spatial4n.Core.NTS.pdb
  94. 0 ...{RavenDB.Database.2.0.2230 → RavenDB.Database.2.0.2288-Unstable}/lib/net40/Spatial4n.Core.NTS.xml
  95. BIN version_2_5/packages/RavenDB.Embedded.2.0.2230/RavenDB.Embedded.2.0.2230.nupkg
  96. BIN version_2_5/packages/RavenDB.Embedded.2.0.2230/lib/net40/Raven.Client.Embedded.dll
  97. BIN version_2_5/packages/RavenDB.Embedded.2.0.2230/lib/net40/Raven.Client.Embedded.pdb
  98. BIN version_2_5/packages/RavenDB.Embedded.2.0.2288-Unstable/RavenDB.Embedded.2.0.2288-Unstable.nupkg
  99. +4 −4 ...d.2.0.2230.nuspec → RavenDB.Embedded.2.0.2288-Unstable/RavenDB.Embedded.2.0.2288-Unstable.nuspec}
  100. BIN version_2_5/packages/RavenDB.Embedded.2.0.2288-Unstable/lib/net40/Raven.Client.Embedded.dll
  101. BIN version_2_5/packages/RavenDB.Embedded.2.0.2288-Unstable/lib/net40/Raven.Client.Embedded.pdb
  102. +8 −7 ...venDB.Embedded.2.0.2230 → RavenDB.Embedded.2.0.2288-Unstable}/lib/net40/Raven.Client.Embedded.xml
  103. +6 −0 web.config
@@ -3,6 +3,7 @@
using Raven.Abstractions.Util;
using Raven.Client.Connection;
using Raven.Client.Connection.Async;
+using Raven.Client.Extensions;
namespace RavenCodeSamples.ClientApi.BasicOperations
{
@@ -1,4 +1,37 @@
-namespace RavenCodeSamples.ClientApi.Querying.StaticIndexes
+using System;
+using System.Linq.Expressions;
+using System.Text;
+using Raven.Client;
+using Raven.Client.Indexes;
+
+namespace Foo
+{
+ public interface IHighlights<T>
+ {
+ #region highlights_3
+ IDocumentQuery<T> Highlight(
+ string fieldName,
+ int fragmentLength,
+ int fragmentCount,
+ out FieldHighlightings highlightings);
+
+ IDocumentQuery<T> Highlight<TValue>(
+ Expression<Func<T, TValue>> propertySelector,
+ int fragmentLength,
+ int fragmentCount,
+ out FieldHighlightings highlightings);
+
+ #endregion
+
+ #region highlights_4
+ IDocumentQuery<T> SetHighlighterTags(string preTag, string postTag);
+
+ IDocumentQuery<T> SetHighlighterTags(string[] preTags, string[] postTags);
+ #endregion
+ }
+}
+
+namespace RavenCodeSamples.ClientApi.Querying.StaticIndexes
{
using System.Collections.Generic;
using System.Linq;
@@ -7,9 +40,33 @@
public class Searching : CodeSampleBase
{
+ #region highlights_1
+ public class SearchItem
+ {
+ public string Id { get; set; }
+
+ public string Text { get; set; }
+ }
+
+ public class ContentSearchIndex : AbstractIndexCreationTask<SearchItem>
+ {
+ public ContentSearchIndex()
+ {
+ Map = (docs => from doc in docs
+ select new { doc.Text });
+
+ Index(x => x.Text, FieldIndexing.Analyzed);
+ Store(x => x.Text, FieldStorage.Yes);
+ TermVector(x => x.Text, FieldTermVector.WithPositionsAndOffsets);
+ }
+ }
+ #endregion
+
#region linq_extensions_search_user_class
public class User
{
+ public string Id { get; set; }
+
public string Name { get; set; }
public byte Age { get; set; }
@@ -128,6 +185,45 @@ public Searching()
escapeQueryOptions: EscapeQueryOptions.RawQuery).ToList();
#endregion
}
+
+ using (var session = documentStore.OpenSession())
+ {
+ #region highlights_2
+ FieldHighlightings highlightings;
+
+ var results = session.Advanced.LuceneQuery<SearchItem>("ContentSearchIndex")
+ .Highlight("Text", 128, 1, out highlightings)
+ .Search("Text", "raven")
+ .ToArray();
+
+ var builder = new StringBuilder()
+ .AppendLine("<ul>");
+
+ foreach (var result in results)
+ {
+ var fragments = highlightings.GetFragments(result.Id);
+ builder.AppendLine(string.Format("<li>{0}</li>", fragments.First()));
+ }
+
+ var ul = builder
+ .AppendLine("</ul>")
+ .ToString();
+
+ #endregion
+ }
+
+ using (var session = documentStore.OpenSession())
+ {
+ #region highlights_5
+ FieldHighlightings highlightings;
+
+ var results = session.Advanced.LuceneQuery<SearchItem>("ContentSearchIndex")
+ .Highlight("Text", 128, 1, out highlightings)
+ .SetHighlighterTags("**", "**")
+ .Search("Text", "raven")
+ .ToArray();
+ #endregion
+ }
}
}
}
@@ -2,6 +2,7 @@
{
using Raven.Client;
using Raven.Client.Linq;
+ using Raven.Client.Extensions;
public class WorkingAsynchronously : CodeSampleBase
{
@@ -42,35 +42,35 @@
</Reference>
<Reference Include="Raven.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Client.2.0.2230\lib\net40\Raven.Abstractions.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Client.2.0.2288-Unstable\lib\net40\Raven.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Raven.Bundles.IndexReplication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Bundles.IndexReplication.2.0.2230\lib\net40\Raven.Bundles.IndexReplication.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Bundles.IndexReplication.2.0.2288-Unstable\lib\net40\Raven.Bundles.IndexReplication.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.Authorization, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Client.Authorization.2.0.2230\lib\net40\Raven.Client.Authorization.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Client.Authorization.2.0.2288-Unstable\lib\net40\Raven.Client.Authorization.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.Embedded, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Embedded.2.0.2230\lib\net40\Raven.Client.Embedded.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Embedded.2.0.2288-Unstable\lib\net40\Raven.Client.Embedded.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.Lightweight, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Client.2.0.2230\lib\net40\Raven.Client.Lightweight.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Client.2.0.2288-Unstable\lib\net40\Raven.Client.Lightweight.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.MvcIntegration, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Client.MvcIntegration.2.0.2230\lib\net40\Raven.Client.MvcIntegration.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Client.MvcIntegration.2.0.2288-Unstable\lib\net40\Raven.Client.MvcIntegration.dll</HintPath>
</Reference>
<Reference Include="Raven.Client.UniqueConstraints, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Client.UniqueConstraints.2.0.2230\lib\net40\Raven.Client.UniqueConstraints.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Client.UniqueConstraints.2.0.2288-Unstable\lib\net40\Raven.Client.UniqueConstraints.dll</HintPath>
</Reference>
<Reference Include="Raven.Database, Version=2.0.0.0, Culture=neutral, PublicKeyToken=37f41c7f99471593, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\RavenDB.Database.2.0.2230\lib\net40\Raven.Database.dll</HintPath>
+ <HintPath>..\packages\RavenDB.Database.2.0.2288-Unstable\lib\net40\Raven.Database.dll</HintPath>
</Reference>
<Reference Include="Raven.Smuggler">
<HintPath>..\packages\Other\Raven.Smuggler.dll</HintPath>
@@ -1,4 +1,6 @@
-namespace RavenCodeSamples.Samples.WebApi
+using Raven.Client.Extensions;
+
+namespace RavenCodeSamples.Samples.WebApi
{
namespace Foo
{
@@ -54,8 +54,8 @@ public void Sample()
{
AwsRegionEndpoint = "eu-west-1", // if not specified default is 'us-east-1'
GlacierVaultName = "your_glacier_vault_name",
- Interval = 60, // minutes
- S3BucketName = "your_s3_bucket_name"
+ IntervalMilliseconds = 60 * 60 * 1000, // 60 minutes
+ S3BucketName = "your_s3_bucket_name",
}),
new RavenJObject());
@@ -3,17 +3,17 @@
<package id="Lucene.Net" version="3.0.3" targetFramework="net45" />
<package id="NLog" version="2.0.0.2000" targetFramework="net40" />
<package id="RavenDB.Bundles.IndexReplication" version="2.0.2160-Unstable" targetFramework="net40" />
- <package id="RavenDB.Bundles.IndexReplication" version="2.0.2230" targetFramework="net45" />
+ <package id="RavenDB.Bundles.IndexReplication" version="2.0.2288-Unstable" targetFramework="net45" />
<package id="RavenDB.Client" version="2.0.2160-Unstable" targetFramework="net40" />
- <package id="RavenDB.Client" version="2.0.2230" targetFramework="net45" />
+ <package id="RavenDB.Client" version="2.0.2288-Unstable" targetFramework="net45" />
<package id="RavenDB.Client.Authorization" version="2.0.2160-Unstable" targetFramework="net40" />
- <package id="RavenDB.Client.Authorization" version="2.0.2230" targetFramework="net45" />
- <package id="RavenDB.Client.MvcIntegration" version="2.0.2230" targetFramework="net45" />
- <package id="RavenDB.Client.UniqueConstraints" version="2.0.2230" targetFramework="net45" />
+ <package id="RavenDB.Client.Authorization" version="2.0.2288-Unstable" targetFramework="net45" />
+ <package id="RavenDB.Client.MvcIntegration" version="2.0.2288-Unstable" targetFramework="net45" />
+ <package id="RavenDB.Client.UniqueConstraints" version="2.0.2288-Unstable" targetFramework="net45" />
<package id="RavenDB.Database" version="2.0.2160-Unstable" targetFramework="net40" />
- <package id="RavenDB.Database" version="2.0.2230" targetFramework="net45" />
+ <package id="RavenDB.Database" version="2.0.2288-Unstable" targetFramework="net45" />
<package id="RavenDB.Embedded" version="2.0.2160-Unstable" targetFramework="net40" />
- <package id="RavenDB.Embedded" version="2.0.2230" targetFramework="net45" />
+ <package id="RavenDB.Embedded" version="2.0.2288-Unstable" targetFramework="net45" />
<package id="Rx-Core" version="2.0.21114" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.0.21114" targetFramework="net45" />
<package id="Rx-Linq" version="2.0.21114" targetFramework="net45" />
@@ -111,4 +111,40 @@ The next option `EscapeQueryOptions.AllowAllWildcards` extends the previous one
The last option makes that the query will not be escaped and the raw term will be relayed to Lucene:
-{CODE linq_extensions_search_where_name_raw@ClientApi\Querying\StaticIndexes\Searching.cs /}
+{CODE linq_extensions_search_where_name_raw@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+##Highlights
+
+Another feature called `Highlights` has been added to RavenDB to enhance the search UX.
+
+###Usage
+
+Lets consider a class and index as follows:
+
+{CODE highlights_1@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+Now to use Highlights we just need to use one of the `Highlight` query extension methods. The basic usage can be as simple as:
+
+{CODE highlights_2@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+This will return the list of results and for each result we will be displaying first found fragment with the length up to 128 characters.
+
+###Customization
+
+{CODE highlights_3@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+where:
+* **fieldName** or **propertySelector** is used to mark a field/property for highlight.
+* **fragmentLength** this is the maximum length of text fragments that will be returned.
+* **fragmentCount** this is the maximum number of fragments that will be returned.
+* **highlightings** this will return an instance of a `FieldHighlightings` that contains the highlight fragments for each returned result.
+
+By default, the highlighted text is wrapped with `<b></b>` tags, to change this behavior the `SetHighlighterTags` method was introduced.
+
+{CODE highlights_4@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+Example. To wrap highlighted text with `**` we just need to execute following query:
+
+{CODE highlights_5@ClientApi\Querying\StaticIndexes\Searching.cs /}
+
+{NOTE Default `<b></b>` tags are coloured and colours are returned in following order: `yellow`, `lawngreen`, `aquamarine`, `magenta`, `palegreen`, `coral`, `wheat`, `khaki`, `lime`, `deepskyblue`, `deeppink`, `salmon`, `peachpuff`, `violet`, `mediumpurple`, `palegoldenrod`, `darkkhaki`, `springgreen`, `turquoise` and `powderblue` /}
Binary file not shown.
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
+<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>RavenDB.Bundles.IndexReplication</id>
- <version>2.0.2230</version>
+ <version>2.0.2288-Unstable</version>
<title>RavenDB Index Replication Bundle</title>
<authors>Hibernating Rhinos</authors>
<owners>Hibernating Rhinos</owners>
@@ -14,7 +14,7 @@
<language>en-US</language>
<tags>nosql ravendb raven document database bundles</tags>
<dependencies>
- <dependency id="RavenDB.Database" version="[2.0.2230]" />
+ <dependency id="RavenDB.Database" version="[2.0.2288-Unstable]" />
</dependencies>
<references>
<reference file="Raven.Bundles.IndexReplication.dll" />
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
+<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>RavenDB.Client</id>
- <version>2.0.2230</version>
+ <version>2.0.2288-Unstable</version>
<title>RavenDB Client</title>
<authors>Hibernating Rhinos</authors>
<owners>Hibernating Rhinos</owners>
Oops, something went wrong.

0 comments on commit eb041a8

Please sign in to comment.