From 8652cd5fabcdb88b6f807a8403ed851e23090b95 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Wed, 14 Jun 2023 16:27:00 +0300 Subject: [PATCH 01/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 1 --- .../client-api/session/querying/.docs.json | 2 +- ...-to-perform-queries-lazily.dotnet.markdown | 73 +++++++++++ ...ow-to-perform-queries-lazily.java.markdown | 70 ++++++++++ .../how-to-perform-queries-lazily.js.markdown | 66 ++++++++++ .../Querying/HowToPerformQueriesLazily.cs | 121 ++++++++++++++++++ .../Querying/HowToPerformQueriesLazily.java | 100 +++++++++++++++ .../Querying/howToPerformQueriesLazily.js | 74 +++++++++++ .../client-api/session/querying/.docs.json | 2 +- .../client-api/session/querying/.docs.json | 2 +- .../client-api/session/querying/.docs.json | 2 +- 10 files changed, 508 insertions(+), 4 deletions(-) create mode 100644 Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown create mode 100644 Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown create mode 100644 Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown create mode 100644 Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs create mode 100644 Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToPerformQueriesLazily.java create mode 100644 Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 6a77aac946..362c9eeab7 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -121,7 +121,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "How to Perform Queries Lazily", + "Name": "Perform Queries Lazily", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown new file mode 100644 index 0000000000..88335ae878 --- /dev/null +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown @@ -0,0 +1,73 @@ +# Perform Queries Lazily + +In some situations, query execution must be delayed. To cover such a scenario, `Lazily` and many other query extensions have been introduced. + +{PANEL:Lazily and LazilyAsync} + +{CODE lazy_1@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +| Parameters | | | +| ------------- | ------------- | ----- | +| **onEval** | Action | An action that will be performed on the query results. | + +| Return Value | | +| ------------- | ----- | +| Lazy | Lazy query initializer returning query results. | + +### Example + +{CODE-TABS} +{CODE-TAB:csharp:Sync lazy_2@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Async lazy_3@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TABS/} + +{PANEL/} + +{PANEL:Counts} + +{CODE lazy_4@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +| Return Value | | +| ------------- | ----- | +| Lazy | Lazy query initializer returning a count of matched documents. | + +### Example + +{CODE lazy_5@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +{PANEL/} + +{PANEL:Suggestions} + +{CODE lazy_6@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +| Return Value | | +| ------------- | ----- | +| Lazy> | Lazy query initializer containing a dictionary with suggestions for matching executed query | + +### Example + +{CODE lazy_7@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +{PANEL/} + +{PANEL:Facets} + +{CODE lazy_8@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +| Return Value | | +| ------------- | ----- | +| Lazy> | Lazy query initializer containing a dictionary with facet results matching executed query | + +### Example + +{CODE lazy_9@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} + +{PANEL/} + +## Related Articles + +### Session + +- [How to Query](../../../client-api/session/querying/how-to-query) +- [How to Perform Operations Lazily](../../../client-api/session/how-to/perform-operations-lazily) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown new file mode 100644 index 0000000000..a6cd411b61 --- /dev/null +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown @@ -0,0 +1,70 @@ +# Perform Queries Lazily + +In some situations, query execution must be delayed. To cover such a scenario, `lazily` and many other query extensions have been introduced. + +{PANEL:Lazily} + +{CODE:java lazy_1@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +| Parameters | | | +| ------------- | ------------- | ----- | +| **onEval** | Consumer | An action that will be performed on the query results. | + +| Return Value | | +| ------------- | ----- | +| Lazy | Lazy query initializer returning query results. | + +### Example + +{CODE:java lazy_2@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +{PANEL/} + +{PANEL:Counts} + +{CODE:java lazy_4@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +| Return Value | | +| ------------- | ----- | +| Lazy | Lazy query initializer returning a count of matched documents. | + +### Example + +{CODE:java lazy_5@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +{PANEL/} + +{PANEL:Suggestions} + +{CODE:java lazy_6@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +| Return Value | | +| ------------- | ----- | +| Lazy> | Lazy query initializer containing a map with suggestions for matching executed query | + +### Example + +{CODE:java lazy_7@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +{PANEL/} + +{PANEL:Facets} + +{CODE:java lazy_8@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +| Return Value | | +| ------------- | ----- | +| Lazy> | Lazy query initializer containing a map with facet results matching executed query | + +### Example + +{CODE:java lazy_9@ClientApi\Session\Querying\HowToPerformQueriesLazily.java /} + +{PANEL/} + +## Related Articles + +### Session + +- [How to Query](../../../client-api/session/querying/how-to-query) +- [How to Perform Operations Lazily](../../../client-api/session/how-to/perform-operations-lazily) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown new file mode 100644 index 0000000000..56932bf573 --- /dev/null +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown @@ -0,0 +1,66 @@ +# Perform Queries Lazily + +In some situations, query execution must be delayed. To cover such a scenario, `lazily` and many other query extensions have been introduced. + +{PANEL:Lazily} + +{CODE:nodejs lazy_1@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +| Return Value | | +| ------------- | ----- | +| `Lazy` | Lazy query initializer returning query results. | + +### Example + +{CODE:nodejs lazy_2@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +{PANEL/} + +{PANEL:Counts} + +{CODE:nodejs lazy_4@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +| Return Value | | +| ------------- | ----- | +| `Lazy` | Lazy query initializer returning a count of matched documents. | + +### Example + +{CODE:nodejs lazy_5@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +{PANEL/} + +{PANEL:Suggestions} + +{CODE:nodejs lazy_6@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +| Return Value | | +| ------------- | ----- | +| `Lazy<{ [key]: SuggestionResult }>` | Lazy query initializer containing a map with suggestions for matching executed query | + +### Example + +{CODE:nodejs lazy_7@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +{PANEL/} + +{PANEL:Facets} + +{CODE:nodejs lazy_8@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +| Return Value | | +| ------------- | ----- | +| `Lazy<{ [key]: FacetResult }>` | Lazy query initializer containing a map with facet results matching executed query | + +### Example + +{CODE:nodejs lazy_9@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} + +{PANEL/} + +## Related Articles + +### Session + +- [How to Query](../../../client-api/session/querying/how-to-query) +- [How to Perform Operations Lazily](../../../client-api/session/how-to/perform-operations-lazily) diff --git a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs new file mode 100644 index 0000000000..40dfd1de6c --- /dev/null +++ b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Raven.Client.Documents; +using Raven.Client.Documents.Queries.Facets; +using Raven.Client.Documents.Queries.Suggestions; +using Raven.Documentation.Samples.Orders; + +namespace Raven.Documentation.Samples.ClientApi.Session.Querying +{ + public class HowToPerformQueriesLazily + { + private interface IFoo + { + #region lazy_1 + Lazy> Lazily(); + + Lazy> Lazily(Action> onEval); + + Lazy>> LazilyAsync(); + + Lazy>> LazilyAsync(Action> onEval); + #endregion + + #region lazy_4 + Lazy CountLazily(); + + Lazy> CountLazilyAsync(CancellationToken token = default(CancellationToken)); + #endregion + + + #region lazy_6 + Lazy> ExecuteLazy(Action> onEval = null); + + Lazy>> ExecuteLazyAsync(Action> onEval = null, CancellationToken token = default); + #endregion + + #region lazy_8 + Lazy> ExecuteLazy(Action> onEval = null); + + Lazy>> ExecuteLazyAsync(Action> onEval = null, CancellationToken token = default); + #endregion + } + + public HowToPerformQueriesLazily() + { + using (var store = new DocumentStore()) + { + using (var session = store.OpenSession()) + { + #region lazy_2 + Lazy> employeesLazy = session + .Query() + .Where(x => x.FirstName == "Robert") + .Lazily(); + + IEnumerable employees = employeesLazy.Value; // query will be executed here + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_5 + Lazy countLazy = session + .Query() + .Where(x => x.FirstName == "Robert") + .CountLazily(); + + int count = countLazy.Value; // query will be executed here + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_7 + Lazy> suggestLazy = session + .Query("Employees_ByFullName") + .SuggestUsing(builder => builder.ByField("FullName", "johne")) + .ExecuteLazy(); + + Dictionary suggest = suggestLazy.Value; // query will be executed here + List suggestions = suggest["FullName"].Suggestions; + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_9 + Lazy> facetsLazy = session + .Query("Camera/Costs") + .AggregateUsing("facets/CameraFacets") + .ExecuteLazy(); + + Dictionary facets = facetsLazy.Value; // query will be executed here + FacetResult results = facets["Manufacturer"]; + #endregion + } + } + } + + private async Task LazilyAsync() + { + using (var store = new DocumentStore()) + { + using (var session = store.OpenSession()) + { + #region lazy_3 + Lazy>> employeesLazy = session + .Query() + .Where(x => x.FirstName == "Robert") + .LazilyAsync(); + + IEnumerable employees = await employeesLazy.Value; // query will be executed here + #endregion + } + } + } + } +} diff --git a/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToPerformQueriesLazily.java b/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToPerformQueriesLazily.java new file mode 100644 index 0000000000..1f4e1c4a8b --- /dev/null +++ b/Documentation/5.2/Samples/java/src/test/java/net/ravendb/ClientApi/Session/Querying/HowToPerformQueriesLazily.java @@ -0,0 +1,100 @@ +package net.ravendb.ClientApi.Session.Querying; + +import net.ravendb.client.documents.DocumentStore; +import net.ravendb.client.documents.IDocumentStore; +import net.ravendb.client.documents.Lazy; +import net.ravendb.client.documents.queries.Query; +import net.ravendb.client.documents.queries.facets.FacetResult; +import net.ravendb.client.documents.queries.suggestions.SuggestionResult; +import net.ravendb.client.documents.session.IDocumentSession; + +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +public class HowToPerformQueriesLazily { + + private interface IFoo { + //region lazy_1 + Lazy> lazily(); + + Lazy> lazily(Consumer> onEval); + //endregion + + //region lazy_4 + Lazy countLazily(); + //endregion + + //region lazy_6 + Lazy> executeLazy(); + + Lazy> executeLazy(Consumer> onEval); + //endregion + } + + private interface IFoo2 { + //region lazy_8 + Lazy> executeLazy(); + + Lazy> executeLazy(Consumer> onEval); + //endregion + } + + private static class Employee { + + } + + private static class Camera { + + } + + public HowToPerformQueriesLazily() { + try (IDocumentStore store = new DocumentStore()) { + try (IDocumentSession session = store.openSession()) { + //region lazy_2 + Lazy> employeesLazy = session + .query(Employee.class) + .whereEquals("FirstName", "Robert") + .lazily(); + + List employees = employeesLazy.getValue(); // query will be executed here + //endregion + } + + try (IDocumentSession session = store.openSession()) { + //region lazy_5 + Lazy countLazy = session + .query(Employee.class) + .whereEquals("FirstName", "Robert") + .countLazily(); + + Integer count = countLazy.getValue(); // query will be executed here + //endregion + } + + try (IDocumentSession session = store.openSession()) { + //region lazy_7 + Lazy> suggestLazy = session + .query(Employee.class, Query.index("Employees_ByFullName")) + .suggestUsing(builder -> builder.byField("FullName", "johne")) + .executeLazy(); + + Map suggest = suggestLazy.getValue(); // query will be executed here + List suggestions = suggest.get("FullName").getSuggestions(); + //endregion + } + + try (IDocumentSession session = store.openSession()) { + //region lazy_9 + Lazy> facetsLazy = session + .query(Camera.class, Query.index("Camera/Costs")) + .aggregateUsing("facets/CameraFacets") + .executeLazy(); + + Map facets = facetsLazy.getValue(); // query will be executed here + FacetResult results = facets.get("manufacturer"); + //endregion + } + } + } +} diff --git a/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js new file mode 100644 index 0000000000..e8a3dd0962 --- /dev/null +++ b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js @@ -0,0 +1,74 @@ +import { DocumentStore, AbstractIndexCreationTask } from "ravendb"; + +const documentStore = new DocumentStore(); +const session = documentStore.openSession(); + +{ + const query = session.query(); + //region lazy_1 + query.lazily(); + //endregion + + //region lazy_4 + query.countLazily(); + //endregion + + //region lazy_6 + query.executeLazy(); + //endregion +} + +{ + const query = session.query(); + //region lazy_8 + query.executeLazy(); + //endregion +} + +async function examples() { + { + //region lazy_2 + const employeesLazy = session + .query({ collection: "Employees" }) + .whereEquals("FirstName", "Robert") + .lazily(); + + const employees = await employeesLazy.getValue(); // query will be executed here + //endregion + } + + { + //region lazy_5 + const countLazy = session + .query({ collection: "Employees" }) + .whereEquals("FirstName", "Robert") + .countLazily(); + + const count = await countLazy.getValue(); // query will be executed here + //endregion + } + + { + //region lazy_7 + const suggestLazy = session + .query({ indexName: "Employees_ByFullName" }) + .suggestUsing(builder => builder.byField("FullName", "Johne")) + .executeLazy(); + + const suggestResult = await suggestLazy.getValue(); // query will be executed here + const suggestions = suggestResult["FullName"].suggestions; + //endregion + } + + { + //region lazy_9 + const facetsLazy = session + .query({ indexName: "Camera/Costs" }) + .aggregateUsing("facets/CameraFacets") + .executeLazy(); + + const facets = await facetsLazy.getValue(); // query will be executed here + const results = facets["manufacturer"]; + //endregion + } +} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 9bfb10e1a3..97b48c2571 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -112,7 +112,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "How to Perform Queries Lazily", + "Name": "Perform Queries Lazily", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json index a242bfd670..a3a75c64c5 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -112,7 +112,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "How to Perform Queries Lazily", + "Name": "Perform Queries Lazily", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 7c422182f8..b9f41d1c68 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -117,7 +117,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "How to Perform Queries Lazily", + "Name": "Perform Queries Lazily", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { From eb1b9be0bf32b0115e09f43bed178fffa21c79cc Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Wed, 14 Jun 2023 17:09:25 +0300 Subject: [PATCH 02/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 2 --- .../client-api/session/querying/.docs.json | 6 +++--- .../client-api/session/querying/debugging/.docs.json | 4 ++-- .../querying/debugging/include-explanations.dotnet.markdown | 2 +- .../querying/debugging/include-explanations.java.markdown | 2 +- .../querying/debugging/include-explanations.js.markdown | 2 +- .../querying/debugging/query-timings.dotnet.markdown | 2 +- .../session/querying/debugging/query-timings.java.markdown | 2 +- .../session/querying/debugging/query-timings.js.markdown | 2 +- .../session/querying/how-to-filter-by-field.dotnet.markdown | 2 +- .../session/querying/how-to-filter-by-field.java.markdown | 2 +- .../session/querying/how-to-filter-by-field.js.markdown | 2 +- .../how-to-filter-by-non-existing-field.dotnet.markdown | 2 +- .../how-to-filter-by-non-existing-field.js.markdown | 2 +- .../querying/how-to-make-a-spatial-query.dotnet.markdown | 2 +- .../querying/how-to-make-a-spatial-query.java.markdown | 2 +- .../querying/how-to-make-a-spatial-query.js.markdown | 2 +- .../client-api/session/querying/.docs.json | 6 +++--- .../client-api/session/querying/.docs.json | 6 +++--- .../client-api/session/querying/.docs.json | 6 +++--- .../client-api/session/querying/debugging/.docs.json | 4 ++-- .../querying/debugging/query-timings.dotnet.markdown | 2 +- .../session/querying/debugging/query-timings.java.markdown | 2 +- .../session/querying/debugging/query-timings.js.markdown | 2 +- 23 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 362c9eeab7..202eccae31 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -77,7 +77,7 @@ }, { "Path": "how-to-make-a-spatial-query.markdown", - "Name": "How to Make a Spatial Query", + "Name": "Make a Spatial Query", "DiscussionId": "b62de172-77e9-4241-a525-9ba6cc027860", "Mappings": [ { @@ -98,13 +98,13 @@ }, { "Path": "how-to-filter-by-field.markdown", - "Name": "How to Filter by Field Presence", + "Name": "Filter by Field Presence", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, { "Path": "how-to-filter-by-non-existing-field.markdown", - "Name": "How to Filter by Non-Existing Field", + "Name": "Filter by Non-Existing Field", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json index d8bb75f036..a5fb6200a7 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json @@ -1,13 +1,13 @@ [ { "Path": "include-explanations.markdown", - "Name": "How to Include Query Explanations", + "Name": "Include Query Explanations", "DiscussionId": "2d056281-2f65-4180-a3e1-a6348ec2d230", "Mappings": [] }, { "Path": "query-timings.markdown", - "Name": "How to Include Query Timings", + "Name": "Include Query Timings", "DiscussionId": "873da629-f825-4378-bac9-87153227a41b", "Mappings": [] } diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.dotnet.markdown index e29cebee0d..5bfb8fb0c8 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Include Query Explanations +# Include Query Explanations --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.java.markdown index 78adf19b51..60318af676 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.java.markdown @@ -1,4 +1,4 @@ -# How to include Query Explanations +# Include Query Explanations `includeExplanations` allows to investigate details related to score assigned for each query result. diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.js.markdown index 9f6553a845..5060da4738 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/include-explanations.js.markdown @@ -1,4 +1,4 @@ -# How to Include Query Explanations +# Include Query Explanations --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown index faf8478d6f..02a1e6b981 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown index bba65f189b..e67e994b1a 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings By default, detailed timings (duration of Lucene search, loading documents, transforming results) in queries are turned off, this is due to small overhead that calculation of such timings produces. diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown index bb8f132fbe..fc66c21a19 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.dotnet.markdown index 9b57a09754..2bc6731126 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Filter by Field Presence +# Filter by Field Presence --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.java.markdown index fef0aa198a..7bb8cb75a0 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.java.markdown @@ -1,4 +1,4 @@ -# How to Filter by Field Presence +# Filter by Field Presence --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.js.markdown index 3b34eda220..0951cc24ee 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-field.js.markdown @@ -1,4 +1,4 @@ -# How to Filter by Field Presence +# Filter by Field Presence --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.dotnet.markdown index 30bb3e0975..a5136accc9 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Filter by Non-Existing Field +# Filter by Non-Existing Field --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.js.markdown index ca217997e4..20afb8050c 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-filter-by-non-existing-field.js.markdown @@ -1,4 +1,4 @@ -# How to Filter by Non-Existing Field +# Filter by Non-Existing Field --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.dotnet.markdown index 7bc9be332f..d3c8dda624 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Make a Spatial Query +# Make a Spatial Query --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.java.markdown index 01203be755..a42ff03967 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.java.markdown @@ -1,4 +1,4 @@ -# How to Make a Spatial Query +# Make a Spatial Query Spatial indexes can be queried using the `spatial` method which contains a full spectrum of spatial methods. The following article will cover these methods: diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.js.markdown index 58ebd31daa..8a63067002 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-make-a-spatial-query.js.markdown @@ -1,4 +1,4 @@ -# How to Make a Spatial Query +# Make a Spatial Query --- diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 97b48c2571..644abc30dd 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -72,7 +72,7 @@ }, { "Path": "how-to-make-a-spatial-query.markdown", - "Name": "How to Make a Spatial Query", + "Name": "Make a Spatial Query", "DiscussionId": "b62de172-77e9-4241-a525-9ba6cc027860", "Mappings": [ { @@ -89,13 +89,13 @@ }, { "Path": "how-to-filter-by-field.markdown", - "Name": "How to Filter by Field Presence", + "Name": "Filter by Field Presence", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, { "Path": "how-to-filter-by-non-existing-field.markdown", - "Name": "How to Filter by Non-Existing Field", + "Name": "Filter by Non-Existing Field", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, diff --git a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json index a3a75c64c5..e1c87125ae 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -72,7 +72,7 @@ }, { "Path": "how-to-make-a-spatial-query.markdown", - "Name": "How to Make a Spatial Query", + "Name": "Make a Spatial Query", "DiscussionId": "b62de172-77e9-4241-a525-9ba6cc027860", "Mappings": [ { @@ -89,13 +89,13 @@ }, { "Path": "how-to-filter-by-field.markdown", - "Name": "How to Filter by Field Presence", + "Name": "Filter by Field Presence", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, { "Path": "how-to-filter-by-non-existing-field.markdown", - "Name": "How to Filter by Non-Existing Field", + "Name": "Filter by Non-Existing Field", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json index b9f41d1c68..3f88ee571a 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -77,7 +77,7 @@ }, { "Path": "how-to-make-a-spatial-query.markdown", - "Name": "How to Make a Spatial Query", + "Name": "Make a Spatial Query", "DiscussionId": "b62de172-77e9-4241-a525-9ba6cc027860", "Mappings": [ { @@ -94,13 +94,13 @@ }, { "Path": "how-to-filter-by-field.markdown", - "Name": "How to Filter by Field Presence", + "Name": "Filter by Field Presence", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, { "Path": "how-to-filter-by-non-existing-field.markdown", - "Name": "How to Filter by Non-Existing Field", + "Name": "Filter by Non-Existing Field", "DiscussionId": "bda0ec07-d0f9-46a0-bab7-ca733f692533", "Mappings": [] }, diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json index d8bb75f036..a5fb6200a7 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/.docs.json @@ -1,13 +1,13 @@ [ { "Path": "include-explanations.markdown", - "Name": "How to Include Query Explanations", + "Name": "Include Query Explanations", "DiscussionId": "2d056281-2f65-4180-a3e1-a6348ec2d230", "Mappings": [] }, { "Path": "query-timings.markdown", - "Name": "How to Include Query Timings", + "Name": "Include Query Timings", "DiscussionId": "873da629-f825-4378-bac9-87153227a41b", "Mappings": [] } diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown index 38bee661c4..c567397d8c 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings --- diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown index 565584a03e..301cdc6cdb 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.java.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings --- diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown index bc12189820..d8257a6599 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/debugging/query-timings.js.markdown @@ -1,4 +1,4 @@ -# How to Include Query Timings +# Include Query Timings --- From da53eb0512ccdfbb38f48760ae144f5fe8231b3d Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Thu, 15 Jun 2023 12:27:52 +0300 Subject: [PATCH 03/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 3 --- .../querying/how-to-stream-query-results.dotnet.markdown | 2 +- .../querying/how-to-stream-query-results.java.markdown | 2 +- .../session/querying/how-to-stream-query-results.js.markdown | 2 +- .../client-api/session/querying/.docs.json | 4 ++-- .../session/querying/how-to-customize-query.dotnet.markdown | 2 +- .../session/querying/how-to-customize-query.java.markdown | 3 ++- .../session/querying/how-to-customize-query.js.markdown | 2 +- .../client-api/session/querying/.docs.json | 4 ++-- .../client-api/session/querying/.docs.json | 4 ++-- .../client-api/session/querying/.docs.json | 4 ++-- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.dotnet.markdown b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.dotnet.markdown index 2e07288bfa..860cfac5f0 100644 --- a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.dotnet.markdown +++ b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Stream Query Results +# Stream Query Results --- diff --git a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.java.markdown b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.java.markdown index 53eccbcd73..cc85494ea9 100644 --- a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.java.markdown +++ b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.java.markdown @@ -1,4 +1,4 @@ -# How to Stream Query Results +# Stream Query Results Query results can be streamed using the `stream` method from the `advanced` session operations. The query can be issued using either a static index, or it can be a dynamic one where it will be handled by an auto index. diff --git a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.js.markdown b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.js.markdown index 323ea85261..3049c32436 100644 --- a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.js.markdown +++ b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/querying/how-to-stream-query-results.js.markdown @@ -1,4 +1,4 @@ -# How to Stream Query Results +# Stream Query Results --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 202eccae31..b585af83a7 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -28,7 +28,7 @@ }, { "Path": "how-to-stream-query-results.markdown", - "Name": "How to Stream Query Results", + "Name": "Stream Query Results", "DiscussionId": "c96a370e-8d0d-4e8f-93b3-03a8105e8b0e", "Mappings": [ { @@ -39,7 +39,7 @@ }, { "Path": "how-to-customize-query.markdown", - "Name": "How to Customize Query", + "Name": "Customize Query", "DiscussionId": "73dfb483-1fca-4fca-a1a4-15c7366b4775", "Mappings": [] }, diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.dotnet.markdown index 83255689e3..c2c12bc926 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Customize a Query +# Customize Query --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.java.markdown index 84cf9322c0..b7a0edc1d5 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.java.markdown @@ -1,4 +1,5 @@ -# How to Customize a Query +# Customize Query + --- {NOTE: } diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.js.markdown index 2d1687a8f4..884dc7e417 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-customize-query.js.markdown @@ -1,4 +1,4 @@ -# How to Customize a Query +# Customize Query --- diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 644abc30dd..6feae4b7d6 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -23,7 +23,7 @@ }, { "Path": "how-to-stream-query-results.markdown", - "Name": "How to Stream Query Results", + "Name": "Stream Query Results", "DiscussionId": "c96a370e-8d0d-4e8f-93b3-03a8105e8b0e", "Mappings": [ { @@ -34,7 +34,7 @@ }, { "Path": "how-to-customize-query.markdown", - "Name": "How to Customize Query", + "Name": "Customize Query", "DiscussionId": "73dfb483-1fca-4fca-a1a4-15c7366b4775", "Mappings": [] }, diff --git a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json index e1c87125ae..7d06c330c9 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -23,7 +23,7 @@ }, { "Path": "how-to-stream-query-results.markdown", - "Name": "How to Stream Query Results", + "Name": "Stream Query Results", "DiscussionId": "c96a370e-8d0d-4e8f-93b3-03a8105e8b0e", "Mappings": [ { @@ -34,7 +34,7 @@ }, { "Path": "how-to-customize-query.markdown", - "Name": "How to Customize Query", + "Name": "Customize Query", "DiscussionId": "73dfb483-1fca-4fca-a1a4-15c7366b4775", "Mappings": [] }, diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 3f88ee571a..e4c31551cf 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -28,7 +28,7 @@ }, { "Path": "how-to-stream-query-results.markdown", - "Name": "How to Stream Query Results", + "Name": "Stream Query Results", "DiscussionId": "c96a370e-8d0d-4e8f-93b3-03a8105e8b0e", "Mappings": [ { @@ -39,7 +39,7 @@ }, { "Path": "how-to-customize-query.markdown", - "Name": "How to Customize Query", + "Name": "Customize Query", "DiscussionId": "73dfb483-1fca-4fca-a1a4-15c7366b4775", "Mappings": [] }, From 4c94fa5c4589ce011fe47a0d4088dc2de5548bb1 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Thu, 15 Jun 2023 13:16:21 +0300 Subject: [PATCH 04/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 4 --- .../how-to/perform-operations-lazily.dotnet.markdown | 4 ++-- .../how-to/perform-operations-lazily.dotnet.markdown | 4 ++-- .../session/how-to/perform-operations-lazily.js.markdown | 6 +++--- .../how-to/perform-operations-lazily.dotnet.markdown | 4 ++-- .../session/how-to/perform-operations-lazily.js.markdown | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 286daa1fd4..f5fa65b6f4 100644 --- a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -39,7 +39,7 @@ Loading entities with include can be executed __lazily__. {CODE-TABS} -{CODE-TAB:csharp:Lazy-load-with-include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} @@ -70,7 +70,7 @@ {NOTE: } __Run query__ -* A Query can be executing a __lazily__. +* A Query can be executed __lazily__. Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE lazy_Query@ClientApi\Session\HowTo\Lazy.cs /} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 38b1537c4d..5b3ce83aec 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -39,7 +39,7 @@ Loading entities with include can be executed __lazily__. {CODE-TABS} -{CODE-TAB:csharp:Lazy-load-with-include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} @@ -70,7 +70,7 @@ {NOTE: } __Run query__ -* A Query can be executing a __lazily__. +* A Query can be executed __lazily__. Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE lazy_Query@ClientApi\Session\HowTo\Lazy.cs /} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index 43231a2e86..c26214f721 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -39,8 +39,8 @@ Loading entities with include can be executed __lazily__. {CODE-TABS} -{CODE-TAB:nodejs:Lazy-load-with-include lazy_loadWithInclude@ClientApi\Session\HowTo\lazy.js /} -{CODE-TAB:nodejs:Sample-document lazy_productClass@ClientApi\Session\HowTo\lazy.js /} +{CODE-TAB:nodejs:Lazy_load_with_include lazy_loadWithInclude@ClientApi\Session\HowTo\lazy.js /} +{CODE-TAB:nodejs:The_document lazy_productClass@ClientApi\Session\HowTo\lazy.js /} {CODE-TABS/} {NOTE/} @@ -70,7 +70,7 @@ {NOTE: } __Run query__ -* A Query can be executing a __lazily__. +* A Query can be executed __lazily__. Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE:nodejs lazy_query@ClientApi\Session\HowTo\lazy.js /} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 13e98343f8..5ec2e168ee 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -39,7 +39,7 @@ Loading entities with include can be executed __lazily__. {CODE-TABS} -{CODE-TAB:csharp:Lazy-load-with-include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} @@ -70,7 +70,7 @@ {NOTE: } __Run query__ -* A Query can be executing a __lazily__. +* A Query can be executed __lazily__. Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE lazy_Query@ClientApi\Session\HowTo\Lazy.cs /} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index 435482bd64..9beb4a9413 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -39,8 +39,8 @@ Loading entities with include can be executed __lazily__. {CODE-TABS} -{CODE-TAB:nodejs:Lazy-load-with-include lazy_loadWithInclude@client-api\Session\HowTo\lazy.js /} -{CODE-TAB:nodejs:Sample-document lazy_productClass@client-api\Session\HowTo\lazy.js /} +{CODE-TAB:nodejs:Lazy_load_with_include lazy_loadWithInclude@client-api\Session\HowTo\lazy.js /} +{CODE-TAB:nodejs:The_document lazy_productClass@client-api\Session\HowTo\lazy.js /} {CODE-TABS/} {NOTE/} @@ -70,7 +70,7 @@ {NOTE: } __Run query__ -* A Query can be executing a __lazily__. +* A Query can be executed __lazily__. Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE:nodejs lazy_query@client-api\Session\HowTo\lazy.js /} From 9d5daa1fb1790a00fe6d48f55547c41dac472286 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Thu, 15 Jun 2023 17:13:39 +0300 Subject: [PATCH 05/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 5 --- .../perform-operations-lazily.dotnet.markdown | 2 +- .../client-api/session/how-to/.docs.json | 2 +- .../perform-operations-lazily.dotnet.markdown | 4 +-- .../perform-operations-lazily.js.markdown | 2 +- .../client-api/session/querying/.docs.json | 2 +- ...-to-perform-queries-lazily.dotnet.markdown | 32 +++++++++++++++++-- ...ow-to-perform-queries-lazily.java.markdown | 2 +- .../how-to-perform-queries-lazily.js.markdown | 2 +- .../client-api/session/how-to/.docs.json | 2 +- .../perform-operations-lazily.dotnet.markdown | 4 +-- .../perform-operations-lazily.js.markdown | 2 +- .../client-api/session/querying/.docs.json | 2 +- .../client-api/session/how-to/.docs.json | 2 +- .../client-api/session/querying/.docs.json | 2 +- .../client-api/session/how-to/.docs.json | 2 +- .../client-api/session/querying/.docs.json | 2 +- 16 files changed, 47 insertions(+), 19 deletions(-) diff --git a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index f5fa65b6f4..57d39b3f98 100644 --- a/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.1/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -40,7 +40,7 @@ {CODE-TABS} {CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} -{CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:The_document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/.docs.json index e86101a892..eda0d8b7c7 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/.docs.json @@ -25,7 +25,7 @@ }, { "Path": "perform-operations-lazily.markdown", - "Name": "...perform operations lazily", + "Name": "...perform requests lazily", "DiscussionId": "7a54c2fc-67ee-40e6-94b5-1266e990cf57", "Mappings": [ { diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 5b3ce83aec..3b1db176da 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Perform Operations Lazily +# Perform requests lazily --- @@ -40,7 +40,7 @@ {CODE-TABS} {CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} -{CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:The_document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index c26214f721..13ddf0275d 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -1,4 +1,4 @@ -# How to Perform Operations Lazily +# Perform requests lazily --- diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json index b585af83a7..3a802ef4cb 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -121,7 +121,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "Perform Queries Lazily", + "Name": "Perform a Lazy Query", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown index 88335ae878..8c12c30f1e 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown @@ -1,6 +1,34 @@ -# Perform Queries Lazily +# Perform a Lazy Query -In some situations, query execution must be delayed. To cover such a scenario, `Lazily` and many other query extensions have been introduced. +--- + +{NOTE: } + +* Query execution can be deferred. + You can __define a query as lazy__ and only execute it later when the query results are actually needed. + +* The lazy query definition is stored in the session and a `Lazy` instance is returned. + The query is executed on the server only when you access the value of this instance. + +* You can __define multiple lazy requests__, one after another, and no network activity will be triggered. + However, as soon as you access the value of one of those lazy instances, + all pending lazy requests held up by the session will be sent to the server as a single unit. + This can help reduce the number of remote calls made to the server over the network. + +* Besides queries, other request types can be executed lazily within a session. + See [perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily). + +* In this page: + * Lazy query + * Lazy count query + * Lazy suggestion query + * Lazy facets query + * Multiple lazy queries + * Syntax + +{NOTE/} + +--- {PANEL:Lazily and LazilyAsync} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown index a6cd411b61..8ebb454aad 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.java.markdown @@ -1,4 +1,4 @@ -# Perform Queries Lazily +# Perform a Lazy Query In some situations, query execution must be delayed. To cover such a scenario, `lazily` and many other query extensions have been introduced. diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown index 56932bf573..4c36aa239c 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown @@ -1,4 +1,4 @@ -# Perform Queries Lazily +# Perform a Lazy Query In some situations, query execution must be delayed. To cover such a scenario, `lazily` and many other query extensions have been introduced. diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/.docs.json b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/.docs.json index e86101a892..eda0d8b7c7 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/.docs.json +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/.docs.json @@ -25,7 +25,7 @@ }, { "Path": "perform-operations-lazily.markdown", - "Name": "...perform operations lazily", + "Name": "...perform requests lazily", "DiscussionId": "7a54c2fc-67ee-40e6-94b5-1266e990cf57", "Mappings": [ { diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 5ec2e168ee..d7e434923a 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -1,4 +1,4 @@ -# How to Perform Operations Lazily +# Perform requests lazily --- @@ -40,7 +40,7 @@ {CODE-TABS} {CODE-TAB:csharp:Lazy_load_with_include lazy_LoadWithInclude@ClientApi\Session\HowTo\Lazy.cs /} -{CODE-TAB:csharp:The-document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} +{CODE-TAB:csharp:The_document lazy_productClass@ClientApi\Session\HowTo\Lazy.cs /} {CODE-TABS/} {NOTE/} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index 9beb4a9413..7c73a33585 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -1,4 +1,4 @@ -# How to Perform Operations Lazily +# Perform requests lazily --- diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 6feae4b7d6..02bea03a93 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -112,7 +112,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "Perform Queries Lazily", + "Name": "Perform a Lazy Query", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/how-to/.docs.json b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/how-to/.docs.json index 89d3a488f4..826e8b74a5 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/how-to/.docs.json +++ b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/how-to/.docs.json @@ -25,7 +25,7 @@ }, { "Path": "perform-operations-lazily.markdown", - "Name": "...perform operations lazily", + "Name": "...perform requests lazily", "DiscussionId": "7a54c2fc-67ee-40e6-94b5-1266e990cf57", "Mappings": [ { diff --git a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json index 7d06c330c9..035bcf2f4c 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/5.4/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -112,7 +112,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "Perform Queries Lazily", + "Name": "Perform a Lazy Query", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/how-to/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/how-to/.docs.json index 89d3a488f4..826e8b74a5 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/how-to/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/how-to/.docs.json @@ -25,7 +25,7 @@ }, { "Path": "perform-operations-lazily.markdown", - "Name": "...perform operations lazily", + "Name": "...perform requests lazily", "DiscussionId": "7a54c2fc-67ee-40e6-94b5-1266e990cf57", "Mappings": [ { diff --git a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json index e4c31551cf..dc6f388361 100644 --- a/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json +++ b/Documentation/6.0/Raven.Documentation.Pages/client-api/session/querying/.docs.json @@ -117,7 +117,7 @@ }, { "Path": "how-to-perform-queries-lazily.markdown", - "Name": "Perform Queries Lazily", + "Name": "Perform a Lazy Query", "DiscussionId": "a359f844-7193-4228-98e0-81a07e561a8b", "Mappings": [ { From 1c0839b37b74096efd4d563756e58a80495aadbe Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Fri, 16 Jun 2023 14:38:39 +0300 Subject: [PATCH 06/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 6 --- .../perform-operations-lazily.dotnet.markdown | 56 +++++++++++++------ ...-to-perform-queries-lazily.dotnet.markdown | 8 +-- .../ClientApi/Session/HowTo/Lazy.cs | 46 +++++++++++++-- 3 files changed, 84 insertions(+), 26 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 3b1db176da..4716d8927a 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -4,24 +4,38 @@ {NOTE: } -* **Defining a lazy operation** allows deferring the execution of the operation until it is needed. +* __Lazy request__: -* Multiple pending lazy operations can be executed together, see below. + * You can define a lazy request within a session (e.g. a lazy-query or a lazy-load request) + and defer its execution until actually needed. + + * The lazy request definition is stored in the session and a `Lazy` instance is returned. + The request will be sent to the server and executed only when you access the value of this instance. + +* __Multiple lazy requests__: + + * Multiple lazy requests can be defined within the same session. + + * When triggering the deferred execution (whether implicitly or explicitly), + ALL pending lazy requests held up by the session will be sent to the server in a single call. + This can help reduce the number of remote calls made to the server over the network. * In this page: - * [Operations that can be executed lazily](../../../client-api/session/how-to/perform-operations-lazily#operations-that-can-be-executed-lazily) - * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) - * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) - * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) - * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) - * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) - * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) - * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) - * [Execute all pending lazy operations](../../../client-api/session/how-to/perform-operations-lazily#execute-all-pending-lazy-operations) + * [Requests that can be executed lazily:](../../../client-api/session/how-to/perform-operations-lazily#requests-that-can-be-executed-lazily) + * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) + * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) + * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) + * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) + * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) + * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) + * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) + * [Multiple lazy requests](../../../client-api/session/how-to/perform-operations-lazily#multiple-lazy-requests) + * [Execute all requests - implicitly](../../../client-api/session/how-to/perform-operations-lazily#implicit) + * [Execute all requests - explicitly](../../../client-api/session/how-to/perform-operations-lazily#explicit) {NOTE/} -{PANEL: Operations that can be executed lazily} +{PANEL: Requests that can be executed lazily} {NOTE: } __Load entities__ @@ -71,7 +85,7 @@ __Run query__ * A Query can be executed __lazily__. - Learn more about running queries lazily in [lazy queries](../../../client-api/session/querying/how-to-perform-queries-lazily). + Find more lazy queries examples in [perform a lazy query](../../../client-api/session/querying/how-to-perform-queries-lazily). {CODE lazy_Query@ClientApi\Session\HowTo\Lazy.cs /} {NOTE/} @@ -94,11 +108,21 @@ {PANEL/} -{PANEL: Execute all pending lazy operations} +{PANEL: Multiple lazy requests } -* Use `ExecuteAllPendingLazyOperations` to execute **all** pending lazy operations at once. +{NOTE: } + __Execute all Requests - Implicitly__ + +{CODE lazy_ExecuteAll_Implicit@ClientApi\Session\HowTo\Lazy.cs /} -{CODE lazy_ExecuteAllPendingLazyOperations@ClientApi\Session\HowTo\Lazy.cs /} +{NOTE/} + +{NOTE: } + __Execute all Requests - Explicitly__ + +{CODE lazy_ExecuteAll_Explicit@ClientApi\Session\HowTo\Lazy.cs /} + +{NOTE/} {PANEL/} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown index 8c12c30f1e..c61c260847 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown @@ -4,7 +4,7 @@ {NOTE: } -* Query execution can be deferred. +* [Query](../../../client-api/session/querying/how-to-query) execution can be deferred. You can __define a query as lazy__ and only execute it later when the query results are actually needed. * The lazy query definition is stored in the session and a `Lazy` instance is returned. @@ -12,7 +12,7 @@ * You can __define multiple lazy requests__, one after another, and no network activity will be triggered. However, as soon as you access the value of one of those lazy instances, - all pending lazy requests held up by the session will be sent to the server as a single unit. + ALL pending lazy requests held up by the session will be sent to the server as a single unit. This can help reduce the number of remote calls made to the server over the network. * Besides queries, other request types can be executed lazily within a session. @@ -97,5 +97,5 @@ ### Session -- [How to Query](../../../client-api/session/querying/how-to-query) -- [How to Perform Operations Lazily](../../../client-api/session/how-to/perform-operations-lazily) +- [Query overview](../../../client-api/session/querying/how-to-query) +- [Perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily) diff --git a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs index 2e1dd6ddec..d892d0ab61 100644 --- a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs +++ b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs @@ -116,7 +116,7 @@ public Lazy() using (var session = store.OpenSession()) { #region lazy_Revisions - var lazyRevisions = session + Lazy> lazyRevisions = session // Add a call to Lazily .Advanced.Revisions.Lazily // Revisions will Not be fetched here, no server call is made @@ -140,7 +140,7 @@ public Lazy() session.SaveChanges(); // Get the compare-exchange value lazily: - var lazyCmpXchg = session + Lazy> lazyCmpXchg = session // Add a call to Lazily .Advanced.ClusterTransaction.Lazily // Compare-exchange values will Not be fetched here, no server call is made @@ -156,19 +156,53 @@ public Lazy() using (var session = store.OpenSession()) { - #region lazy_ExecuteAllPendingLazyOperations + #region lazy_ExecuteAll_Implicit // Define multiple lazy requests Lazy lazyUser1 = session.Advanced.Lazily.Load("users/1-A"); Lazy lazyUser2 = session.Advanced.Lazily.Load("users/2-A"); - Lazy> lazyEmployees = session.Query().Lazily(); + + Lazy> lazyEmployees = session.Query() + .Lazily(); + Lazy> lazyProducts = session.Query() + .Search(x => x.Name, "Ch*") + .Lazily(); + + // Accessing the value of ANY of the lazy instances will trigger + // the execution of ALL pending lazy requests held up by the session + // This is done in a SINGLE server call + User user1 = lazyUser1.Value; + + // ALL the other values are now also available + // No additional server calls are made when accessing these values + User user2 = lazyUser2.Value; + IEnumerable employees = lazyEmployees.Value; + IEnumerable products = lazyProducts.Value; + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_ExecuteAll_Explicit + // Define multiple lazy requests + Lazy lazyUser1 = session.Advanced.Lazily.Load("users/1-A"); + Lazy lazyUser2 = session.Advanced.Lazily.Load("users/2-A"); + + Lazy> lazyEmployees = session.Query() + .Lazily(); + Lazy> lazyProducts = session.Query() + .Search(x => x.Name, "Ch*") + .Lazily(); - // Execute all pending lazy operations + // Explicitly call 'ExecuteAllPendingLazyOperations' + // ALL pending lazy requests held up by the session will be executed in a SINGLE server call session.Advanced.Eagerly.ExecuteAllPendingLazyOperations(); - // All values are now available + // ALL values are now available + // No additional server calls are made when accessing the values User user1 = lazyUser1.Value; User user2 = lazyUser2.Value; IEnumerable employees = lazyEmployees.Value; + IEnumerable products = lazyProducts.Value; #endregion } } From 6c7d8d72073a4f29edb92729192d8f982fe2b835 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Fri, 23 Jun 2023 11:58:12 +0300 Subject: [PATCH 07/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 7 --- .../perform-operations-lazily.dotnet.markdown | 4 +- ...-to-perform-queries-lazily.dotnet.markdown | 104 +++---- .../Querying/HowToPerformQueriesLazily.cs | 285 ++++++++++++++---- .../Indexes/Querying/QueryIndex.cs | 2 +- 4 files changed, 278 insertions(+), 117 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 4716d8927a..8f098aa4ad 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -111,14 +111,14 @@ {PANEL: Multiple lazy requests } {NOTE: } - __Execute all Requests - Implicitly__ + __Execute all requests - implicitly__ {CODE lazy_ExecuteAll_Implicit@ClientApi\Session\HowTo\Lazy.cs /} {NOTE/} {NOTE: } - __Execute all Requests - Explicitly__ + __Execute all requests - explicitly__ {CODE lazy_ExecuteAll_Explicit@ClientApi\Session\HowTo\Lazy.cs /} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown index c61c260847..9408c3d663 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown @@ -4,92 +4,86 @@ {NOTE: } -* [Query](../../../client-api/session/querying/how-to-query) execution can be deferred. - You can __define a query as lazy__ and only execute it later when the query results are actually needed. +* Query execution can be deferred. + You can __define a query as lazy__ and execute it later when query results are actually needed. -* The lazy query definition is stored in the session and a `Lazy` instance is returned. - The query is executed on the server only when you access the value of this instance. - -* You can __define multiple lazy requests__, one after another, and no network activity will be triggered. - However, as soon as you access the value of one of those lazy instances, - ALL pending lazy requests held up by the session will be sent to the server as a single unit. - This can help reduce the number of remote calls made to the server over the network. - -* Besides queries, other request types can be executed lazily within a session. - See [perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily). +* This article contains lazy queries examples. + __Prior to this article__, please refer to [perform requests lazily](../../../) for general knowledge about + RavenDB's lazy behavior, and other request types that can be executed lazily within a session. * In this page: - * Lazy query - * Lazy count query - * Lazy suggestion query - * Lazy facets query - * Multiple lazy queries - * Syntax + * [Lazy query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-query) + * [Lazy count query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-count-query) + * [Lazy suggestions query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-suggestions-query) + * [Lazy facets query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-facets-query) + * [Syntax](../../../client-api/session/querying/how-to-perform-queries-lazily#syntax) {NOTE/} --- -{PANEL:Lazily and LazilyAsync} +{PANEL: Lazy query} -{CODE lazy_1@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TABS} +{CODE-TAB:csharp:Lazy_query lazy_1@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_query_async lazy_2@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_documentQuery lazy_3@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TABS/} -| Parameters | | | -| ------------- | ------------- | ----- | -| **onEval** | Action | An action that will be performed on the query results. | +* Learn more about queries in this [query overview](../../../client-api/session/querying/how-to-query). -| Return Value | | -| ------------- | ----- | -| Lazy | Lazy query initializer returning query results. | +{PANEL/} -### Example +{PANEL: Lazy count query} {CODE-TABS} -{CODE-TAB:csharp:Sync lazy_2@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} -{CODE-TAB:csharp:Async lazy_3@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_query lazy_4@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_query_async lazy_5@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_documentQuery lazy_6@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} {CODE-TABS/} {PANEL/} -{PANEL:Counts} - -{CODE lazy_4@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} - -| Return Value | | -| ------------- | ----- | -| Lazy | Lazy query initializer returning a count of matched documents. | +{PANEL: Lazy suggestions query} -### Example +{CODE-TABS} +{CODE-TAB:csharp:Lazy_query lazy_7@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_query_async lazy_8@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_documentQuery lazy_9@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TABS/} -{CODE lazy_5@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +* Learn more about suggestions in [query for suggestions](../../../client-api/session/querying/how-to-work-with-suggestions). {PANEL/} -{PANEL:Suggestions} - -{CODE lazy_6@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} - -| Return Value | | -| ------------- | ----- | -| Lazy> | Lazy query initializer containing a dictionary with suggestions for matching executed query | +{PANEL: Lazy facets query} -### Example +{CODE-TABS} +{CODE-TAB:csharp:Lazy_query lazy_10@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_query_async lazy_11@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Lazy_documentQuery lazy_12@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Facets_definition the_facets@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TAB:csharp:Index_definition the_index@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE-TABS/} -{CODE lazy_7@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +* Learn more about facets in [perform faceted search](../../../client-api/session/querying/how-to-perform-a-faceted-search). {PANEL/} -{PANEL:Facets} - -{CODE lazy_8@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{PANEL: Syntax} -| Return Value | | -| ------------- | ----- | -| Lazy> | Lazy query initializer containing a dictionary with facet results matching executed query | +{CODE syntax_1@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE syntax_2@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE syntax_3@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +{CODE syntax_4@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} -### Example +| Parameters | Type | Description | +|------------|-----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| +| __onEval__ | `Action>`
`Action>`
`Action>` | An action that will be performed on the query results
when the query is executed. | -{CODE lazy_9@ClientApi\Session\Querying\HowToPerformQueriesLazily.cs /} +| Return Value | | +|----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------| +| `Lazy>`
`Lazy`
`Lazy>`
`Lazy>` | A lazy instance that will evaluate the query only when needed. | {PANEL/} diff --git a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs index 40dfd1de6c..fc14f681ca 100644 --- a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs +++ b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/Querying/HowToPerformQueriesLazily.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Threading.Tasks; using Raven.Client.Documents; +using Raven.Client.Documents.Indexes; using Raven.Client.Documents.Queries.Facets; using Raven.Client.Documents.Queries.Suggestions; using Raven.Documentation.Samples.Orders; @@ -12,110 +13,276 @@ namespace Raven.Documentation.Samples.ClientApi.Session.Querying { public class HowToPerformQueriesLazily { - private interface IFoo - { - #region lazy_1 - Lazy> Lazily(); - - Lazy> Lazily(Action> onEval); - - Lazy>> LazilyAsync(); - - Lazy>> LazilyAsync(Action> onEval); - #endregion - - #region lazy_4 - Lazy CountLazily(); - - Lazy> CountLazilyAsync(CancellationToken token = default(CancellationToken)); - #endregion - - - #region lazy_6 - Lazy> ExecuteLazy(Action> onEval = null); - - Lazy>> ExecuteLazyAsync(Action> onEval = null, CancellationToken token = default); - #endregion - - #region lazy_8 - Lazy> ExecuteLazy(Action> onEval = null); - - Lazy>> ExecuteLazyAsync(Action> onEval = null, CancellationToken token = default); - #endregion - } - - public HowToPerformQueriesLazily() + public async Task LazyQueries() { using (var store = new DocumentStore()) { using (var session = store.OpenSession()) + { + #region lazy_1 + // Define a lazy query + Lazy> lazyEmployees = session + .Query() + .Where(x => x.FirstName == "Robert") + // Add a call to 'Lazily' + .Lazily(); + + IEnumerable employees = lazyEmployees.Value; // Query is executed here + #endregion + } + + using (var asyncSession = store.OpenAsyncSession()) { #region lazy_2 - Lazy> employeesLazy = session + // Define a lazy query + Lazy>> lazyEmployees = asyncSession .Query() .Where(x => x.FirstName == "Robert") + // Add a call to 'LazilyAsync' + .LazilyAsync(); + + IEnumerable employees = await lazyEmployees.Value; // Query is executed here + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_3 + // Define a lazy DocumentQuery + Lazy> lazyEmployees = session.Advanced + .DocumentQuery() + .WhereEquals(x => x.FirstName, "Robert") + // Add a call to 'Lazily' .Lazily(); - IEnumerable employees = employeesLazy.Value; // query will be executed here + IEnumerable employees = lazyEmployees.Value; // DocumentQuery is executed here #endregion } using (var session = store.OpenSession()) + { + #region lazy_4 + // Define a lazy count query + Lazy lazyCount = session + .Query() + .Where(x => x.FirstName == "Robert") + // Add a call to 'CountLazily' + .CountLazily(); + + int count = lazyCount.Value; // Query is executed here + #endregion + } + + using (var asyncSession = store.OpenAsyncSession()) { #region lazy_5 - Lazy countLazy = session + // Define a lazy count query + Lazy> lazyCount = asyncSession .Query() .Where(x => x.FirstName == "Robert") + // Add a call to 'CountLazilyAsync' + .CountLazilyAsync(); + + int count = await lazyCount.Value; // Query is executed here + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_6 + // Define a lazy DocumentQuery + Lazy lazyCount = session.Advanced + .DocumentQuery() + .WhereEquals(x => x.FirstName, "Robert") + // Add a call to 'CountLazily' .CountLazily(); - int count = countLazy.Value; // query will be executed here + int count = lazyCount.Value; // DocumentQuery is executed here #endregion } using (var session = store.OpenSession()) { #region lazy_7 - Lazy> suggestLazy = session - .Query("Employees_ByFullName") - .SuggestUsing(builder => builder.ByField("FullName", "johne")) + // Define a lazy suggestion query + Lazy> lazySuggestions = session + .Query() + .SuggestUsing(builder => builder.ByField(x => x.Name, "chaig")) + // Add a call to 'ExecuteLazy' .ExecuteLazy(); - Dictionary suggest = suggestLazy.Value; // query will be executed here - List suggestions = suggest["FullName"].Suggestions; + Dictionary suggest = lazySuggestions.Value; // Query is executed here + List suggestions = suggest["Name"].Suggestions; #endregion } + + using (var asyncSession = store.OpenAsyncSession()) + { + #region lazy_8 + // Define a lazy suggestion query + Lazy>> lazySuggestions = asyncSession + .Query() + .SuggestUsing(builder => builder.ByField("Name", "chaig")) + // Add a call to 'ExecuteLazyAsync' + .ExecuteLazyAsync(); + Dictionary suggest = await lazySuggestions.Value; // Query is executed here + List suggestions = suggest["Name"].Suggestions; + #endregion + } + using (var session = store.OpenSession()) { #region lazy_9 - Lazy> facetsLazy = session - .Query("Camera/Costs") - .AggregateUsing("facets/CameraFacets") + // Define a lazy DocumentQuery + Lazy> lazySuggestions = session.Advanced + .DocumentQuery() + .SuggestUsing(builder => builder.ByField("Name", "chaig")) + // Add a call to 'ExecuteLazy' .ExecuteLazy(); - Dictionary facets = facetsLazy.Value; // query will be executed here - FacetResult results = facets["Manufacturer"]; + Dictionary suggest = lazySuggestions.Value; // DocumentQuery is executed here + List suggestions = suggest["FullName"].Suggestions; #endregion } - } - } - private async Task LazilyAsync() - { - using (var store = new DocumentStore()) - { + #region the_facets + // The facets definition used in the facets query: + List facetsDefinition = new List + { + new Facet + { + FieldName = "CategoryName", + DisplayFieldName = "Product Category" + }, + new RangeFacet + { + Ranges = + { + product => product.PricePerUnit < 25, + product => product.PricePerUnit >= 25 && product.PricePerUnit < 50, + product => product.PricePerUnit >= 50 && product.PricePerUnit < 100, + product => product.PricePerUnit >= 100 + }, + DisplayFieldName = "Price per Unit" + } + }; + #endregion + using (var session = store.OpenSession()) { - #region lazy_3 - Lazy>> employeesLazy = session - .Query() - .Where(x => x.FirstName == "Robert") - .LazilyAsync(); + #region lazy_10 + // Define a lazy facets query + Lazy> lazyFacets = session + .Query() + .AggregateBy(facetsDefinition) + // Add a call to 'ExecuteLazy' + .ExecuteLazy(); + + Dictionary facets = lazyFacets.Value; // Query is executed here + + FacetResult categoryResults = facets["Product Category"]; + FacetResult priceResults = facets["Price per Unit"]; + #endregion + } + + using (var asyncSession = store.OpenSession()) + { + #region lazy_11 + // Define a lazy DocumentQuery + Lazy>> lazyFacets = asyncSession + .Query() + .AggregateBy(facetsDefinition) + // Add a call to 'ExecuteLazyAsync' + .ExecuteLazyAsync(); + + Dictionary facets = await lazyFacets.Value; // Query is executed here + + FacetResult categoryResults = facets["Product Category"]; + FacetResult priceResults = facets["Price per Unit"]; + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_12 + // Define a lazy DocumentQuery + Lazy> lazyFacets = session.Advanced + .DocumentQuery() + .AggregateBy(facetsDefinition) + // Add a call to 'ExecuteLazy' + .ExecuteLazy(); - IEnumerable employees = await employeesLazy.Value; // query will be executed here + Dictionary facets = lazyFacets.Value; // DocumentQuery is executed here + + FacetResult categoryResults = facets["Product Category"]; + FacetResult priceResults = facets["Price per Unit"]; #endregion } } } + + private interface IFoo + { + #region syntax_1 + // Lazy query overloads: + Lazy> Lazily(); + Lazy> Lazily(Action> onEval); + + Lazy>> LazilyAsync(); + Lazy>> LazilyAsync(Action> onEval); + #endregion + + #region syntax_2 + // Lazy count query overloads: + Lazy CountLazily(); + Lazy> CountLazilyAsync(CancellationToken token = default(CancellationToken)); + #endregion + + #region syntax_3 + // Lazy suggestions query overloads: + Lazy> + ExecuteLazy(Action> onEval = null); + + Lazy>> + ExecuteLazyAsync(Action> onEval = null, + CancellationToken token = default); + #endregion + + #region syntax_4 + // Lazy facets query overloads: + Lazy> + ExecuteLazy(Action> onEval = null); + + Lazy>> + ExecuteLazyAsync(Action> onEval = null, + CancellationToken token = default); + #endregion + } + } + + #region the_index + // The index definition used in the facets query: + public class Products_ByCategoryAndPrice : + AbstractIndexCreationTask + { + // The IndexEntry class defines the index-fields + public class IndexEntry + { + public string CategoryName { get; set; } + public decimal PricePerUnit { get; set; } + } + + public Products_ByCategoryAndPrice() + { + // The 'Map' function defines the content of the index-fields + Map = products => from product in products + select new IndexEntry + { + CategoryName = LoadDocument(product.Category).Name, + PricePerUnit = product.PricePerUnit + }; + } } + #endregion } diff --git a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/Indexes/Querying/QueryIndex.cs b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/Indexes/Querying/QueryIndex.cs index 719284fee9..cbc1ca65f2 100644 --- a/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/Indexes/Querying/QueryIndex.cs +++ b/Documentation/5.2/Samples/csharp/Raven.Documentation.Samples/Indexes/Querying/QueryIndex.cs @@ -13,7 +13,7 @@ namespace Raven.Documentation.Samples.Indexes.Querying public class Employees_ByName : AbstractIndexCreationTask { - // The IndexEntry class defines the index-fields. + // The IndexEntry class defines the index-fields public class IndexEntry { public string FirstName { get; set; } From 192ec101218ca4708f895c5fcd92e9580c4a450e Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Sun, 25 Jun 2023 12:20:21 +0300 Subject: [PATCH 08/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 8 --- ...-to-perform-queries-lazily.dotnet.markdown | 2 +- .../how-to-perform-queries-lazily.js.markdown | 77 ++++++----- .../Querying/howToPerformQueriesLazily.js | 122 ++++++++++++------ 3 files changed, 125 insertions(+), 76 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown index 9408c3d663..315d092ea2 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.dotnet.markdown @@ -8,7 +8,7 @@ You can __define a query as lazy__ and execute it later when query results are actually needed. * This article contains lazy queries examples. - __Prior to this article__, please refer to [perform requests lazily](../../../) for general knowledge about + __Prior to this article__, please refer to [perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily) for general knowledge about RavenDB's lazy behavior, and other request types that can be executed lazily within a session. * In this page: diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown index 4c36aa239c..96df2f6d0d 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/querying/how-to-perform-queries-lazily.js.markdown @@ -1,60 +1,71 @@ # Perform a Lazy Query -In some situations, query execution must be delayed. To cover such a scenario, `lazily` and many other query extensions have been introduced. +--- -{PANEL:Lazily} +{NOTE: } -{CODE:nodejs lazy_1@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +* Query execution can be deferred. + You can __define a query as lazy__ and execute it later when query results are actually needed. -| Return Value | | -| ------------- | ----- | -| `Lazy` | Lazy query initializer returning query results. | +* This article contains lazy queries examples. + __Prior to this article__, please refer to [perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily) for general knowledge about + RavenDB's lazy behavior, and other request types that can be executed lazily within a session. -### Example +* In this page: + * [Lazy query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-query) + * [Lazy count query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-count-query) + * [Lazy suggestions query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-suggestions-query) + * [Lazy facets query](../../../client-api/session/querying/how-to-perform-queries-lazily#lazy-facets-query) + * [Syntax](../../../client-api/session/querying/how-to-perform-queries-lazily#syntax) -{CODE:nodejs lazy_2@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{NOTE/} -{PANEL/} +--- -{PANEL:Counts} +{PANEL: Lazy query} -{CODE:nodejs lazy_4@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{CODE:nodejs lazy_1@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} -| Return Value | | -| ------------- | ----- | -| `Lazy` | Lazy query initializer returning a count of matched documents. | +* Learn more about queries in this [query overview](../../../client-api/session/querying/how-to-query). -### Example +{PANEL/} -{CODE:nodejs lazy_5@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{PANEL: Lazy count query} + +{CODE:nodejs lazy_2@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} {PANEL/} -{PANEL:Suggestions} +{PANEL: Lazy suggestions query} -{CODE:nodejs lazy_6@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{CODE:nodejs lazy_3@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} -| Return Value | | -| ------------- | ----- | -| `Lazy<{ [key]: SuggestionResult }>` | Lazy query initializer containing a map with suggestions for matching executed query | +* Learn more about suggestions in [query for suggestions](../../../client-api/session/querying/how-to-work-with-suggestions). -### Example +{PANEL/} -{CODE:nodejs lazy_7@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{PANEL: Lazy facets query} -{PANEL/} +{CODE-TABS} +{CODE-TAB:nodejs:Lazy_query lazy_4@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{CODE-TAB:nodejs:Index_definition the_index@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{CODE-TABS/} -{PANEL:Facets} +* Learn more about facets in [perform faceted search](../../../client-api/session/querying/how-to-perform-a-faceted-search). + +{PANEL/} -{CODE:nodejs lazy_8@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +{PANEL: Syntax} -| Return Value | | -| ------------- | ----- | -| `Lazy<{ [key]: FacetResult }>` | Lazy query initializer containing a map with facet results matching executed query | +{CODE:nodejs syntax@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} -### Example +| Parameters | Type | Description | +|------------|----------------------|--------------------------------------------------------------------------------------| +| __onEval__ | `(object[]) => void` | An action that will be performed on the query results
when the query is executed. | -{CODE:nodejs lazy_9@ClientApi\Session\Querying\howToPerformQueriesLazily.js /} +| Return Value | | +|--------------|------------------------------------------------------------------| +| __object__ | A `Lazy` instance that will evaluate the query only when needed. | {PANEL/} @@ -62,5 +73,5 @@ In some situations, query execution must be delayed. To cover such a scenario, ` ### Session -- [How to Query](../../../client-api/session/querying/how-to-query) -- [How to Perform Operations Lazily](../../../client-api/session/how-to/perform-operations-lazily) +- [Query overview](../../../client-api/session/querying/how-to-query) +- [Perform requests lazily](../../../client-api/session/how-to/perform-operations-lazily) diff --git a/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js index e8a3dd0962..fffbd4a164 100644 --- a/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js +++ b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/howToPerformQueriesLazily.js @@ -1,74 +1,112 @@ -import { DocumentStore, AbstractIndexCreationTask } from "ravendb"; +import { DocumentStore, AbstractJavaScriptIndexCreationTask, Facet, RangeFacet } from "ravendb"; const documentStore = new DocumentStore(); const session = documentStore.openSession(); -{ - const query = session.query(); - //region lazy_1 - query.lazily(); - //endregion - - //region lazy_4 - query.countLazily(); - //endregion - - //region lazy_6 - query.executeLazy(); - //endregion -} - -{ - const query = session.query(); - //region lazy_8 - query.executeLazy(); - //endregion -} - -async function examples() { +async function lazyExamples() { { - //region lazy_2 - const employeesLazy = session + //region lazy_1 + // Define a lazy query + const lazyEmployees = session .query({ collection: "Employees" }) .whereEquals("FirstName", "Robert") + // Add a call to 'lazily' .lazily(); - const employees = await employeesLazy.getValue(); // query will be executed here + const employees = await lazyEmployees.getValue(); // Query is executed here //endregion } { - //region lazy_5 - const countLazy = session + //region lazy_2 + // Define a lazy count query + const lazyCount = session .query({ collection: "Employees" }) .whereEquals("FirstName", "Robert") + // Add a call to 'countLazily' .countLazily(); - const count = await countLazy.getValue(); // query will be executed here + const count = await lazyCount.getValue(); // Query is executed here //endregion } { - //region lazy_7 - const suggestLazy = session - .query({ indexName: "Employees_ByFullName" }) - .suggestUsing(builder => builder.byField("FullName", "Johne")) + //region lazy_3 + // Define a lazy suggestion query + const lazySuggestions = session + .query({ collection: "Products" }) + .suggestUsing(builder => builder.byField("Name", "chaig")) + // Add a call to 'executeLazy' .executeLazy(); - const suggestResult = await suggestLazy.getValue(); // query will be executed here - const suggestions = suggestResult["FullName"].suggestions; + const suggestResult = await lazySuggestions.getValue(); // Query is executed here + const suggestions = suggestResult["Name"].suggestions; //endregion } { - //region lazy_9 - const facetsLazy = session - .query({ indexName: "Camera/Costs" }) - .aggregateUsing("facets/CameraFacets") + //region lazy_4 + // The facets definition used in the facets query: + // =============================================== + const categoryNameFacet = new Facet(); + + categoryNameFacet.fieldName = "categoryName"; + categoryNameFacet.displayFieldName = "Product Category"; + + const rangeFacet = new RangeFacet(); + rangeFacet.ranges = [ + "pricePerUnit < " + 25, + "pricePerUnit >= " + 25 + " and pricePerUnit < " + 50, + "pricePerUnit >= " + 50 + " and pricePerUnit < " + 100, + "pricePerUnit >= " + 100 + ]; + rangeFacet.displayFieldName = 'Price per Unit'; + + const facetsDefinition = [categoryNameFacet, rangeFacet]; + + // The lazy factes query: + // ====================== + const lazyFacets = session + .query({ indexName: "Products/ByCategoryAndPrice" }) + .aggregateBy(...facetsDefinition) + // Add a call to 'executeLazy' .executeLazy(); - const facets = await facetsLazy.getValue(); // query will be executed here - const results = facets["manufacturer"]; + const facets = await lazyFacets.getValue(); // Query is executed here + + const categoryResults = facets["Product Category"]; + const priceResults = facets["Price per Unit"]; //endregion } } + +{ + //region the_index + // The index definition used in the facets query: + class Products_ByCategoryAndPrice extends AbstractJavaScriptIndexCreationTask { + constructor() { + super(); + + const { load } = this.mapUtils(); + + this.map("Products", product => { + return { + categoryName: load(product.Category, "Categories").Name, + pricePerUnit: product.PricePerUnit + } + }); + } + } + //endregion +} + +{ + //region syntax + lazily(); + lazily(onEval); + + countLazily(); + + executeLazy(); + //endregion +} From 2edce6afb5cfc2d581f5d665f6843d657637758d Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Sun, 25 Jun 2023 13:57:17 +0300 Subject: [PATCH 09/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 9 --- .../session/loading-entities.dotnet.markdown | 24 +++++++++-------- .../session/loading-entities.js.markdown | 27 +++++++++++++------ .../Session/Querying/workWithSuggestions.js | 2 +- .../session/loading-entities.dotnet.markdown | 24 +++++++++-------- .../session/loading-entities.js.markdown | 27 +++++++++++++------ 5 files changed, 65 insertions(+), 39 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown index 06fd19e48d..8c78292901 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown @@ -3,17 +3,19 @@ {NOTE: } -There are several methods with many overloads that allow users to download documents -from the database and convert them to entities. This article will cover the following -methods: - -- [Load](../../client-api/session/loading-entities#load) -- [Load with Includes](../../client-api/session/loading-entities#load-with-includes) -- [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) -- [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) -- [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) -- [Stream](../../client-api/session/loading-entities#stream) -- [IsLoaded](../../client-api/session/loading-entities#isloaded) +* There are several methods that allow users to load documents from the database and convert them to entities. + +* This article covers the following methods: + + - [Load](../../client-api/session/loading-entities#load) + - [Load with Includes](../../client-api/session/loading-entities#load-with-includes) + - [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) + - [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) + - [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) + - [Stream](../../client-api/session/loading-entities#stream) + - [IsLoaded](../../client-api/session/loading-entities#isloaded) + +* For loading entities lazily see [perform requests lazily](../../client-api/session/how-to/perform-operations-lazily). {NOTE/} diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown index f1adf1170b..c0bd8b9ae0 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown @@ -1,14 +1,25 @@ # Session: Loading Entities +--- -There are various methods with many overloads that allow users to download documents from a database and convert them to entities. This article will cover the following methods: +{NOTE: } -- [Load](../../client-api/session/loading-entities#load) -- [Load with Includes](../../client-api/session/loading-entities#load-with-includes) -- [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) -- [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) -- [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) -- [IsLoaded](../../client-api/session/loading-entities#isloaded) -- [Stream](../../client-api/session/loading-entities#stream) +* There are several methods that allow users to load documents from the database and convert them to entities. + +* This article covers the following methods: + + - [Load](../../client-api/session/loading-entities#load) + - [Load with Includes](../../client-api/session/loading-entities#load-with-includes) + - [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) + - [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) + - [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) + - [IsLoaded](../../client-api/session/loading-entities#isloaded) + - [Stream](../../client-api/session/loading-entities#stream) + +* For loading entities lazily see [perform requests lazily](../../client-api/session/how-to/perform-operations-lazily). + +{NOTE/} + +--- {PANEL:Load} diff --git a/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/workWithSuggestions.js b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/workWithSuggestions.js index 5dd67c9c17..bfb6d1c44a 100644 --- a/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/workWithSuggestions.js +++ b/Documentation/5.2/Samples/nodejs/ClientApi/Session/Querying/workWithSuggestions.js @@ -9,7 +9,7 @@ async function suggestions() { // This dynamic query on the 'Products' collection has NO resulting documents const products = await session .query({ collection: "Products" }) - .where(x => x.Name == "chaig") + .whereEquals("Name", "Chai") .all(); //endregion } diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown index c2ea2171b8..ef277fe7b1 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.dotnet.markdown @@ -3,17 +3,19 @@ {NOTE: } -There are several methods with many overloads that allow users to download documents -from the database and convert them to entities. This article will cover the following -methods: - -- [Load](../../client-api/session/loading-entities#load) -- [Load with Includes](../../client-api/session/loading-entities#load-with-includes) -- [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) -- [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) -- [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) -- [Stream](../../client-api/session/loading-entities#stream) -- [IsLoaded](../../client-api/session/loading-entities#isloaded) +* There are several methods that allow users to load documents from the database and convert them to entities. + +* This article covers the following methods: + + - [Load](../../client-api/session/loading-entities#load) + - [Load with Includes](../../client-api/session/loading-entities#load-with-includes) + - [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) + - [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) + - [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) + - [Stream](../../client-api/session/loading-entities#stream) + - [IsLoaded](../../client-api/session/loading-entities#isloaded) + +* For loading entities lazily see [perform requests lazily](../../client-api/session/how-to/perform-operations-lazily). {NOTE/} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown index 8f533d76de..b33d77365a 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/loading-entities.js.markdown @@ -1,14 +1,25 @@ # Session: Loading Entities +--- -There are various methods with many overloads that allow users to download documents from a database and convert them to entities. This article will cover the following methods: +{NOTE: } -- [Load](../../client-api/session/loading-entities#load) -- [Load with Includes](../../client-api/session/loading-entities#load-with-includes) -- [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) -- [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) -- [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) -- [IsLoaded](../../client-api/session/loading-entities#isloaded) -- [Stream](../../client-api/session/loading-entities#stream) +* There are several methods that allow users to load documents from the database and convert them to entities. + +* This article covers the following methods: + + - [Load](../../client-api/session/loading-entities#load) + - [Load with Includes](../../client-api/session/loading-entities#load-with-includes) + - [Load - multiple entities](../../client-api/session/loading-entities#load---multiple-entities) + - [LoadStartingWith](../../client-api/session/loading-entities#loadstartingwith) + - [ConditionalLoad](../../client-api/session/loading-entities#conditionalload) + - [IsLoaded](../../client-api/session/loading-entities#isloaded) + - [Stream](../../client-api/session/loading-entities#stream) + +* For loading entities lazily see [perform requests lazily](../../client-api/session/how-to/perform-operations-lazily). + +{NOTE/} + +--- {PANEL:Load} From 5a27a44d90419030b93ac876c3fe5b1191d8d2b2 Mon Sep 17 00:00:00 2001 From: danielle9897 Date: Sun, 25 Jun 2023 14:36:55 +0300 Subject: [PATCH 10/10] RDoc-2451 Client API > Session > Querying > Queries lazily - Part 10 --- .../perform-operations-lazily.dotnet.markdown | 3 +- .../perform-operations-lazily.js.markdown | 55 ++++++++++++++----- .../nodejs/ClientApi/Session/HowTo/lazy.js | 40 ++++++++++++-- .../perform-operations-lazily.dotnet.markdown | 55 ++++++++++++++----- .../perform-operations-lazily.js.markdown | 55 ++++++++++++++----- .../ClientApi/Session/HowTo/Lazy.cs | 46 ++++++++++++++-- .../nodejs/client-api/Session/HowTo/lazy.js | 40 ++++++++++++-- 7 files changed, 234 insertions(+), 60 deletions(-) diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index 8f098aa4ad..a4243cd39e 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -1,5 +1,4 @@ # Perform requests lazily - --- {NOTE: } @@ -35,6 +34,8 @@ {NOTE/} +--- + {PANEL: Requests that can be executed lazily} {NOTE: } diff --git a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index 13ddf0275d..89eef4eec8 100644 --- a/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.2/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -1,26 +1,41 @@ # Perform requests lazily - --- {NOTE: } -* **Defining a lazy operation** allows deferring the execution of the operation until it is needed. +* __Lazy request__: + + * You can define a lazy request within a session (e.g. a lazy-query or a lazy-load request) + and defer its execution until actually needed. + + * The lazy request definition is stored in the session and a `Lazy` instance is returned. + The request will be sent to the server and executed only when you access the value of this instance. + +* __Multiple lazy requests__: -* Multiple pending lazy operations can be executed together, see below. + * Multiple lazy requests can be defined within the same session. + + * When triggering the deferred execution (whether implicitly or explicitly), + ALL pending lazy requests held up by the session will be sent to the server in a single call. + This can help reduce the number of remote calls made to the server over the network. * In this page: - * [Operations that can be executed lazily](../../../client-api/session/how-to/perform-operations-lazily#operations-that-can-be-executed-lazily) - * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) - * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) - * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) - * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) - * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) - * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) - * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) - * [Execute all pending lazy operations](../../../client-api/session/how-to/perform-operations-lazily#execute-all-pending-lazy-operations) + * [Requests that can be executed lazily:](../../../client-api/session/how-to/perform-operations-lazily#requests-that-can-be-executed-lazily) + * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) + * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) + * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) + * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) + * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) + * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) + * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) + * [Multiple lazy requests](../../../client-api/session/how-to/perform-operations-lazily#multiple-lazy-requests) + * [Execute all requests - implicitly](../../../client-api/session/how-to/perform-operations-lazily#implicit) + * [Execute all requests - explicitly](../../../client-api/session/how-to/perform-operations-lazily#explicit) {NOTE/} +--- + {PANEL: Operations that can be executed lazily} {NOTE: } @@ -94,11 +109,21 @@ {PANEL/} -{PANEL: Execute all pending lazy operations} +{PANEL: Multiple lazy requests } -* Use `executeAllPendingLazyOperations` to execute **all** pending lazy operations at once. +{NOTE: } +
__Execute all requests - implicitly__ -{CODE:nodejs lazy_executeAllPendingLazyOperations@ClientApi\Session\HowTo\lazy.js /} +{CODE:nodejs lazy_ExecuteAll_Implicit@ClientApi\Session\HowTo\lazy.js /} + +{NOTE/} + +{NOTE: } + __Execute all requests - explicitly__ + +{CODE:nodejs lazy_ExecuteAll_Explicit@ClientApi\Session\HowTo\lazy.js /} + +{NOTE/} {PANEL/} diff --git a/Documentation/5.2/Samples/nodejs/ClientApi/Session/HowTo/lazy.js b/Documentation/5.2/Samples/nodejs/ClientApi/Session/HowTo/lazy.js index f68bdb30e8..311e99a378 100644 --- a/Documentation/5.2/Samples/nodejs/ClientApi/Session/HowTo/lazy.js +++ b/Documentation/5.2/Samples/nodejs/ClientApi/Session/HowTo/lazy.js @@ -134,19 +134,51 @@ async function lazyExamples() { //endregion } { - //region lazy_executeAllPendingLazyOperations + //region lazy_ExecuteAll_Implicit // Define multiple lazy requests const lazyUser1 = session.advanced.lazily.load("users/1-A"); const lazyUser2 = session.advanced.lazily.load("users/2-A"); - const lazyEmployees = session.query({ collection: "employees" }).lazily(); + + const lazyEmployees = session.query({ collection: "employees" }) + .lazily(); + const lazyProducts = session.query({ collection: "products" }) + .search("Name", "Ch*") + .lazily(); + + // Accessing the value of ANY of the lazy instances will trigger + // the execution of ALL pending lazy requests held up by the session + // This is done in a SINGLE server call + const user1 = await lazyUser1.getValue(); + + // ALL the other values are now also available + // No additional server calls are made when accessing these values + const user2 = await lazyUser2.getValue(); + const employees = await lazyEmployees.getValue(); + const products = await lazyProducts.getValue(); + //endregion + } + { + //region lazy_ExecuteAll_Explicit + // Define multiple lazy requests + const lazyUser1 = session.advanced.lazily.load("users/1-A"); + const lazyUser2 = session.advanced.lazily.load("users/2-A"); + + const lazyEmployees = session.query({ collection: "employees" }) + .lazily(); + const lazyProducts = session.query({ collection: "products" }) + .search("Name", "Ch*") + .lazily(); - // Execute all pending lazy operations + // Explicitly call 'executeAllPendingLazyOperations' + // ALL pending lazy requests held up by the session will be executed in a SINGLE server call await session.advanced.eagerly.executeAllPendingLazyOperations(); - // All values are now available + // ALL values are now available + // No additional server calls are made when accessing the values const user1 = await lazyUser1.getValue(); const user2 = await lazyUser2.getValue(); const employees = await lazyEmployees.getValue(); + const products = await lazyProducts.getValue(); //endregion } { diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown index d7e434923a..14cd80c0e7 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.dotnet.markdown @@ -1,26 +1,41 @@ # Perform requests lazily - --- {NOTE: } -* **Defining a lazy operation** allows deferring the execution of the operation until it is needed. +* __Lazy request__: + + * You can define a lazy request within a session (e.g. a lazy-query or a lazy-load request) + and defer its execution until actually needed. + + * The lazy request definition is stored in the session and a `Lazy` instance is returned. + The request will be sent to the server and executed only when you access the value of this instance. + +* __Multiple lazy requests__: -* Multiple pending lazy operations can be executed together, see below. + * Multiple lazy requests can be defined within the same session. + + * When triggering the deferred execution (whether implicitly or explicitly), + ALL pending lazy requests held up by the session will be sent to the server in a single call. + This can help reduce the number of remote calls made to the server over the network. * In this page: - * [Operations that can be executed lazily](../../../client-api/session/how-to/perform-operations-lazily#operations-that-can-be-executed-lazily) - * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) - * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) - * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) - * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) - * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) - * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) - * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) - * [Execute all pending lazy operations](../../../client-api/session/how-to/perform-operations-lazily#execute-all-pending-lazy-operations) + * [Requests that can be executed lazily:](../../../client-api/session/how-to/perform-operations-lazily#requests-that-can-be-executed-lazily) + * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) + * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) + * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) + * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) + * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) + * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) + * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) + * [Multiple lazy requests](../../../client-api/session/how-to/perform-operations-lazily#multiple-lazy-requests) + * [Execute all requests - implicitly](../../../client-api/session/how-to/perform-operations-lazily#implicit) + * [Execute all requests - explicitly](../../../client-api/session/how-to/perform-operations-lazily#explicit) {NOTE/} +--- + {PANEL: Operations that can be executed lazily} {NOTE: } @@ -94,11 +109,21 @@ {PANEL/} -{PANEL: Execute all pending lazy operations} +{PANEL: Multiple lazy requests } -* Use `ExecuteAllPendingLazyOperations` to execute **all** pending lazy operations at once. +{NOTE: } + __Execute all requests - implicitly__ -{CODE lazy_ExecuteAllPendingLazyOperations@ClientApi\Session\HowTo\Lazy.cs /} +{CODE lazy_ExecuteAll_Implicit@ClientApi\Session\HowTo\Lazy.cs /} + +{NOTE/} + +{NOTE: } + __Execute all requests - explicitly__ + +{CODE lazy_ExecuteAll_Explicit@ClientApi\Session\HowTo\Lazy.cs /} + +{NOTE/} {PANEL/} diff --git a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown index 7c73a33585..db31b993eb 100644 --- a/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown +++ b/Documentation/5.3/Raven.Documentation.Pages/client-api/session/how-to/perform-operations-lazily.js.markdown @@ -1,26 +1,41 @@ # Perform requests lazily - --- {NOTE: } -* **Defining a lazy operation** allows deferring the execution of the operation until it is needed. +* __Lazy request__: + + * You can define a lazy request within a session (e.g. a lazy-query or a lazy-load request) + and defer its execution until actually needed. + + * The lazy request definition is stored in the session and a `Lazy` instance is returned. + The request will be sent to the server and executed only when you access the value of this instance. + +* __Multiple lazy requests__: -* Multiple pending lazy operations can be executed together, see below. + * Multiple lazy requests can be defined within the same session. + + * When triggering the deferred execution (whether implicitly or explicitly), + ALL pending lazy requests held up by the session will be sent to the server in a single call. + This can help reduce the number of remote calls made to the server over the network. * In this page: - * [Operations that can be executed lazily](../../../client-api/session/how-to/perform-operations-lazily#operations-that-can-be-executed-lazily) - * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) - * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) - * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) - * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) - * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) - * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) - * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) - * [Execute all pending lazy operations](../../../client-api/session/how-to/perform-operations-lazily#execute-all-pending-lazy-operations) + * [Requests that can be executed lazily:](../../../client-api/session/how-to/perform-operations-lazily#requests-that-can-be-executed-lazily) + * [Load entities](../../../client-api/session/how-to/perform-operations-lazily#loadEntities) + * [Load entities with include](../../../client-api/session/how-to/perform-operations-lazily#loadWithInclude) + * [Load entities starting with](../../../client-api/session/how-to/perform-operations-lazily#loadStartingWith) + * [Conditional load](../../../client-api/session/how-to/perform-operations-lazily#conditionalLoad) + * [Run query](../../../client-api/session/how-to/perform-operations-lazily#runQuery) + * [Get revisions](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) + * [Get compare-exchange value](../../../client-api/session/how-to/perform-operations-lazily#getCompareExchange) + * [Multiple lazy requests](../../../client-api/session/how-to/perform-operations-lazily#multiple-lazy-requests) + * [Execute all requests - implicitly](../../../client-api/session/how-to/perform-operations-lazily#implicit) + * [Execute all requests - explicitly](../../../client-api/session/how-to/perform-operations-lazily#explicit) {NOTE/} +--- + {PANEL: Operations that can be executed lazily} {NOTE: } @@ -94,11 +109,21 @@ {PANEL/} -{PANEL: Execute all pending lazy operations} +{PANEL: Multiple lazy requests } -* Use `executeAllPendingLazyOperations` to execute **all** pending lazy operations at once. +{NOTE: } + __Execute all requests - implicitly__ -{CODE:nodejs lazy_executeAllPendingLazyOperations@client-api\Session\HowTo\lazy.js /} +{CODE:nodejs lazy_ExecuteAll_Implicit@client-api\Session\HowTo\lazy.js /} + +{NOTE/} + +{NOTE: } + __Execute all requests - explicitly__ + +{CODE:nodejs lazy_ExecuteAll_Explicit@client-api\Session\HowTo\lazy.js /} + +{NOTE/} {PANEL/} diff --git a/Documentation/5.3/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs b/Documentation/5.3/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs index b406f7f31d..963d738077 100644 --- a/Documentation/5.3/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs +++ b/Documentation/5.3/Samples/csharp/Raven.Documentation.Samples/ClientApi/Session/HowTo/Lazy.cs @@ -116,7 +116,7 @@ public Lazy() using (var session = store.OpenSession()) { #region lazy_Revisions - var lazyRevisions = session + Lazy> lazyRevisions = session // Add a call to Lazily .Advanced.Revisions.Lazily // Revisions will Not be fetched here, no server call is made @@ -140,7 +140,7 @@ public Lazy() session.SaveChanges(); // Get the compare-exchange value lazily: - var lazyCmpXchg = session + Lazy> lazyCmpXchg = session // Add a call to Lazily .Advanced.ClusterTransaction.Lazily // Compare-exchange values will Not be fetched here, no server call is made @@ -156,19 +156,53 @@ public Lazy() using (var session = store.OpenSession()) { - #region lazy_ExecuteAllPendingLazyOperations + #region lazy_ExecuteAll_Implicit // Define multiple lazy requests Lazy lazyUser1 = session.Advanced.Lazily.Load("users/1-A"); Lazy lazyUser2 = session.Advanced.Lazily.Load("users/2-A"); - Lazy> lazyEmployees = session.Query().Lazily(); + + Lazy> lazyEmployees = session.Query() + .Lazily(); + Lazy> lazyProducts = session.Query() + .Search(x => x.Name, "Ch*") + .Lazily(); + + // Accessing the value of ANY of the lazy instances will trigger + // the execution of ALL pending lazy requests held up by the session + // This is done in a SINGLE server call + User user1 = lazyUser1.Value; + + // ALL the other values are now also available + // No additional server calls are made when accessing these values + User user2 = lazyUser2.Value; + IEnumerable employees = lazyEmployees.Value; + IEnumerable products = lazyProducts.Value; + #endregion + } + + using (var session = store.OpenSession()) + { + #region lazy_ExecuteAll_Explicit + // Define multiple lazy requests + Lazy lazyUser1 = session.Advanced.Lazily.Load("users/1-A"); + Lazy lazyUser2 = session.Advanced.Lazily.Load("users/2-A"); + + Lazy> lazyEmployees = session.Query() + .Lazily(); + Lazy> lazyProducts = session.Query() + .Search(x => x.Name, "Ch*") + .Lazily(); - // Execute all pending lazy operations + // Explicitly call 'ExecuteAllPendingLazyOperations' + // ALL pending lazy requests held up by the session will be executed in a SINGLE server call session.Advanced.Eagerly.ExecuteAllPendingLazyOperations(); - // All values are now available + // ALL values are now available + // No additional server calls are made when accessing the values User user1 = lazyUser1.Value; User user2 = lazyUser2.Value; IEnumerable employees = lazyEmployees.Value; + IEnumerable products = lazyProducts.Value; #endregion } } diff --git a/Documentation/5.3/Samples/nodejs/client-api/Session/HowTo/lazy.js b/Documentation/5.3/Samples/nodejs/client-api/Session/HowTo/lazy.js index f68bdb30e8..e848cb16a6 100644 --- a/Documentation/5.3/Samples/nodejs/client-api/Session/HowTo/lazy.js +++ b/Documentation/5.3/Samples/nodejs/client-api/Session/HowTo/lazy.js @@ -134,19 +134,51 @@ async function lazyExamples() { //endregion } { - //region lazy_executeAllPendingLazyOperations + //region lazy_ExecuteAll_Implicit // Define multiple lazy requests const lazyUser1 = session.advanced.lazily.load("users/1-A"); const lazyUser2 = session.advanced.lazily.load("users/2-A"); - const lazyEmployees = session.query({ collection: "employees" }).lazily(); - // Execute all pending lazy operations + const lazyEmployees = session.query({ collection: "employees" }) + .lazily(); + const lazyProducts = session.query({ collection: "products" }) + .search("Name", "Ch*") + .lazily(); + + // Accessing the value of ANY of the lazy instances will trigger + // the execution of ALL pending lazy requests held up by the session + // This is done in a SINGLE server call + const user1 = await lazyUser1.getValue(); + + // ALL the other values are now also available + // No additional server calls are made when accessing these values + const user2 = await lazyUser2.getValue(); + const employees = await lazyEmployees.getValue(); + const products = await lazyProducts.getValue(); + //endregion + } + { + //region lazy_ExecuteAll_Explicit + // Define multiple lazy requests + const lazyUser1 = session.advanced.lazily.load("users/1-A"); + const lazyUser2 = session.advanced.lazily.load("users/2-A"); + + const lazyEmployees = session.query({ collection: "employees" }) + .lazily(); + const lazyProducts = session.query({ collection: "products" }) + .search("Name", "Ch*") + .lazily(); + + // Explicitly call 'executeAllPendingLazyOperations' + // ALL pending lazy requests held up by the session will be executed in a SINGLE server call await session.advanced.eagerly.executeAllPendingLazyOperations(); - // All values are now available + // ALL values are now available + // No additional server calls are made when accessing the values const user1 = await lazyUser1.getValue(); const user2 = await lazyUser2.getValue(); const employees = await lazyEmployees.getValue(); + const products = await lazyProducts.getValue(); //endregion } {