You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/10/29 21:17:08 UTC

[GitHub] [ignite] timoninmaxim opened a new pull request #9545: IGNITE-15475 Add docs for IndexQuery

timoninmaxim opened a new pull request #9545:
URL: https://github.com/apache/ignite/pull/9545


   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740764291



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I submitted you suggestion.

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied you suggestion.

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied your suggestion.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741023785



##########
File path: docs/_docs/code-deployment/peer-class-loading.adoc
##########
@@ -28,12 +28,12 @@ If you develop C# and .NET applications, then refer to the link:net-specific/net
 page for details on how to set up and use the peer-class-loading feature with that type of applications.
 ====
 
-For example, when link:key-value-api/using-scan-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.
+For example, when link:key-value-api/using-cache-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.

Review comment:
       only --> just. You can use both, but just sounds better in this situation.
   loads --> will upload

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Index queries perform over distributed indexes --> Index queries are performed over distributed indexes

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a regular link:key-value-api/using-cache-queries[scan query].
 
 The query condition is specified by an `IgniteBiPredicate<K, V>` object that is passed to the query constructor as an argument. The predicate is applied on the server side. If you don't provide any predicate, the query returns all cache entries.

Review comment:
       If you don't provide any predicate --> If there is no predicate provided

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:
  * 1. If {@link #idxName} is set, then use it.
  * 2. If {@link #idxName} is not set, then find an index that matches criteria fields.
  * 3. If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type.

Review comment:
       . If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type. --> . If neither {@link #idxName}, nor {@link #setCriteria(List)} is used, then perform index scan over PK index for specified Value type.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.

Review comment:
       Questions or bug reports are welcome, please share it with user@ignite.apache.org. --> Please send your questions and bug reports to user@ignite.apache.org.

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
 | The node where read operation is executed.
 It can be either the primary or backup node (the latter case is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]).

Review comment:
       is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]). maybe --> is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups] is enabled).

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       the link is about cache queries, but the alt text is still 'scan query'

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.

Review comment:
       then applies a filter on them. --> then applies a filter to them.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.

Review comment:
       joined
   
   Also it is possible --> it is also possible

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and

Review comment:
       match --> matches

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry

Review comment:
       `IndexQuery` also supports an optional predicate the same as `ScanQuery` have. --> `IndexQuery` also supports an optional predicate, the same as `ScanQuery` has.

##########
File path: examples/src/main/java/org/apache/ignite/examples/model/Person.java
##########
@@ -51,7 +54,7 @@
     public String resume;
 
     /** Salary (indexed). */
-    @QuerySqlField(index = true)
+    @QuerySqlField(index = true, orderedGroups = @QuerySqlField.Group(name = ORG_SALARY_IDX, order = 1))
     public double salary;
 
     /** Custom cache key to guarantee that person is always collocated with its organization. */

Review comment:
       'collocated' was previously spelled as 'colocated'. Please review.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"
+operations, or fields that aren't part of the index.

Review comment:
       that aren't part --> that are not the part

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.

Review comment:
       self --> itself
   
   by specified --> using specified

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the

Review comment:
       performs --> is performed
   
   If also index name isn't specified --> If index name is also not specified

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       perform ---> are performed

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:

Review comment:
       as following --> as follows

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"

Review comment:
       in such cases --> in cases

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741667540



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       Hi! This docs are for the feature that is available since 2.12 only. So, no need to cherry-pick this back.

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       This is OK. I changed the title of part that describes ScanQuery among others cache queries. But this suggestion is about ScanQuery usage. So the link was changed only.

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       Changed to `work`

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Changed to `work`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740764291



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I submitted you suggestion.

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied you suggestion.

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied your suggestion.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741032143



##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Nikita-tech-writer commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Nikita-tech-writer commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740577749



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       How about:"...where it is executed as a **regular** link:key-value-api/using-cache-queries[scan query]."

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @timoninmaxim Perfect! Then the PR can be merged and ported to 2.11 branch (to publish the changes on the website). 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741667540



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       Hi! This docs are for the feature that is available since 2.12 only. So, no need to cherry-pick this back.

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       This is OK. I changed the title of part that describes ScanQuery among others cache queries. But this suggestion is about ScanQuery usage. So the link was changed only.

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       Changed to `work`

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Changed to `work`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741023785



##########
File path: docs/_docs/code-deployment/peer-class-loading.adoc
##########
@@ -28,12 +28,12 @@ If you develop C# and .NET applications, then refer to the link:net-specific/net
 page for details on how to set up and use the peer-class-loading feature with that type of applications.
 ====
 
-For example, when link:key-value-api/using-scan-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.
+For example, when link:key-value-api/using-cache-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.

Review comment:
       only --> just. You can use both, but just sounds better in this situation.
   loads --> will upload

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Index queries perform over distributed indexes --> Index queries are performed over distributed indexes

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a regular link:key-value-api/using-cache-queries[scan query].
 
 The query condition is specified by an `IgniteBiPredicate<K, V>` object that is passed to the query constructor as an argument. The predicate is applied on the server side. If you don't provide any predicate, the query returns all cache entries.

Review comment:
       If you don't provide any predicate --> If there is no predicate provided

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:
  * 1. If {@link #idxName} is set, then use it.
  * 2. If {@link #idxName} is not set, then find an index that matches criteria fields.
  * 3. If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type.

Review comment:
       . If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type. --> . If neither {@link #idxName}, nor {@link #setCriteria(List)} is used, then perform index scan over PK index for specified Value type.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.

Review comment:
       Questions or bug reports are welcome, please share it with user@ignite.apache.org. --> Please send your questions and bug reports to user@ignite.apache.org.

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
 | The node where read operation is executed.
 It can be either the primary or backup node (the latter case is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]).

Review comment:
       is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]). maybe --> is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups] is enabled).

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       the link is about cache queries, but the alt text is still 'scan query'

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.

Review comment:
       then applies a filter on them. --> then applies a filter to them.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.

Review comment:
       joined
   
   Also it is possible --> it is also possible

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and

Review comment:
       match --> matches

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry

Review comment:
       `IndexQuery` also supports an optional predicate the same as `ScanQuery` have. --> `IndexQuery` also supports an optional predicate, the same as `ScanQuery` has.

##########
File path: examples/src/main/java/org/apache/ignite/examples/model/Person.java
##########
@@ -51,7 +54,7 @@
     public String resume;
 
     /** Salary (indexed). */
-    @QuerySqlField(index = true)
+    @QuerySqlField(index = true, orderedGroups = @QuerySqlField.Group(name = ORG_SALARY_IDX, order = 1))
     public double salary;
 
     /** Custom cache key to guarantee that person is always collocated with its organization. */

Review comment:
       'collocated' was previously spelled as 'colocated'. Please review.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"
+operations, or fields that aren't part of the index.

Review comment:
       that aren't part --> that are not the part

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.

Review comment:
       self --> itself
   
   by specified --> using specified

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the

Review comment:
       performs --> is performed
   
   If also index name isn't specified --> If index name is also not specified

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       perform ---> are performed

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:

Review comment:
       as following --> as follows

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"

Review comment:
       in such cases --> in cases

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741023785



##########
File path: docs/_docs/code-deployment/peer-class-loading.adoc
##########
@@ -28,12 +28,12 @@ If you develop C# and .NET applications, then refer to the link:net-specific/net
 page for details on how to set up and use the peer-class-loading feature with that type of applications.
 ====
 
-For example, when link:key-value-api/using-scan-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.
+For example, when link:key-value-api/using-cache-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.

Review comment:
       only --> just. You can use both, but just sounds better in this situation.
   loads --> will upload

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Index queries perform over distributed indexes --> Index queries are performed over distributed indexes

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a regular link:key-value-api/using-cache-queries[scan query].
 
 The query condition is specified by an `IgniteBiPredicate<K, V>` object that is passed to the query constructor as an argument. The predicate is applied on the server side. If you don't provide any predicate, the query returns all cache entries.

Review comment:
       If you don't provide any predicate --> If there is no predicate provided

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:
  * 1. If {@link #idxName} is set, then use it.
  * 2. If {@link #idxName} is not set, then find an index that matches criteria fields.
  * 3. If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type.

Review comment:
       . If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type. --> . If neither {@link #idxName}, nor {@link #setCriteria(List)} is used, then perform index scan over PK index for specified Value type.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.

Review comment:
       Questions or bug reports are welcome, please share it with user@ignite.apache.org. --> Please send your questions and bug reports to user@ignite.apache.org.

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
 | The node where read operation is executed.
 It can be either the primary or backup node (the latter case is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]).

Review comment:
       is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]). maybe --> is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups] is enabled).

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       the link is about cache queries, but the alt text is still 'scan query'

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.

Review comment:
       then applies a filter on them. --> then applies a filter to them.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.

Review comment:
       joined
   
   Also it is possible --> it is also possible

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and

Review comment:
       match --> matches

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry

Review comment:
       `IndexQuery` also supports an optional predicate the same as `ScanQuery` have. --> `IndexQuery` also supports an optional predicate, the same as `ScanQuery` has.

##########
File path: examples/src/main/java/org/apache/ignite/examples/model/Person.java
##########
@@ -51,7 +54,7 @@
     public String resume;
 
     /** Salary (indexed). */
-    @QuerySqlField(index = true)
+    @QuerySqlField(index = true, orderedGroups = @QuerySqlField.Group(name = ORG_SALARY_IDX, order = 1))
     public double salary;
 
     /** Custom cache key to guarantee that person is always collocated with its organization. */

Review comment:
       'collocated' was previously spelled as 'colocated'. Please review.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"
+operations, or fields that aren't part of the index.

Review comment:
       that aren't part --> that are not the part

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.

Review comment:
       self --> itself
   
   by specified --> using specified

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the

Review comment:
       performs --> is performed
   
   If also index name isn't specified --> If index name is also not specified

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       perform ---> are performed

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:

Review comment:
       as following --> as follows

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"

Review comment:
       in such cases --> in cases

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] NSAmelchev merged pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
NSAmelchev merged pull request #9545:
URL: https://github.com/apache/ignite/pull/9545


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741667540



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       Hi! This docs are for the feature that is available since 2.12 only. So, no need to cherry-pick this back.

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       This is OK. I changed the title of part that describes ScanQuery among others cache queries. But this suggestion is about ScanQuery usage. So the link was changed only.

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       Changed to `work`

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Changed to `work`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740764291



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied your suggestion.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Nikita-tech-writer commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Nikita-tech-writer commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741019685



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @timoninmaxim Perfect! Then the PR can be merged and ported to 2.11 branch (to publish the changes on the website). 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740764291



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I submitted you suggestion.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740764291



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @Nikita-tech-writer hi, thanks a lot for review. I applied you suggestion.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Nikita-tech-writer commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Nikita-tech-writer commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740577749



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       How about:"...where it is executed as a **regular** link:key-value-api/using-cache-queries[scan query]."




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741683276



##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Changed to `work`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741667540



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       Hi! This docs are for the feature that is available since 2.12 only. So, no need to cherry-pick this back.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741669596



##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       This is OK. I changed the title of part that describes ScanQuery among others cache queries. But this suggestion is about ScanQuery usage. So the link was changed only.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] timoninmaxim commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
timoninmaxim commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741682359



##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       Changed to `work`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Nikita-tech-writer commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Nikita-tech-writer commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r740577749



##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       How about:"...where it is executed as a **regular** link:key-value-api/using-cache-queries[scan query]."

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-cache-queries[scan query].

Review comment:
       @timoninmaxim Perfect! Then the PR can be merged and ported to 2.11 branch (to publish the changes on the website). 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [ignite] Silberfuchs1 commented on a change in pull request #9545: IGNITE-15745 Add docs for IndexQuery

Posted by GitBox <gi...@apache.org>.
Silberfuchs1 commented on a change in pull request #9545:
URL: https://github.com/apache/ignite/pull/9545#discussion_r741023785



##########
File path: docs/_docs/code-deployment/peer-class-loading.adoc
##########
@@ -28,12 +28,12 @@ If you develop C# and .NET applications, then refer to the link:net-specific/net
 page for details on how to set up and use the peer-class-loading feature with that type of applications.
 ====
 
-For example, when link:key-value-api/using-scan-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.
+For example, when link:key-value-api/using-cache-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.

Review comment:
       only --> just. You can use both, but just sounds better in this situation.
   loads --> will upload

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`

Review comment:
       Index queries perform over distributed indexes --> Index queries are performed over distributed indexes

##########
File path: docs/_docs/thin-clients/java-thin-client.adoc
##########
@@ -132,7 +132,7 @@ include::{sourceCodeFile}[tag=key-value-operations,indent=0]
 -------------------------------------------------------------------------------
 
 === Executing Scan Queries
-Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a normal link:key-value-api/using-scan-queries[scan query].
+Use the `ScanQuery<K, V>` class to get a set of entries that satisfy a given condition. The thin client sends the query to the cluster node where it is executed as a regular link:key-value-api/using-cache-queries[scan query].
 
 The query condition is specified by an `IgniteBiPredicate<K, V>` object that is passed to the query constructor as an argument. The predicate is applied on the server side. If you don't provide any predicate, the query returns all cache entries.

Review comment:
       If you don't provide any predicate --> If there is no predicate provided

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:
  * 1. If {@link #idxName} is set, then use it.
  * 2. If {@link #idxName} is not set, then find an index that matches criteria fields.
  * 3. If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type.

Review comment:
       . If neither of {@link #idxName} or {@link #setCriteria(List)} used, then perform index scan over PK index for specified Value type. --> . If neither {@link #idxName}, nor {@link #setCriteria(List)} is used, then perform index scan over PK index for specified Value type.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.

Review comment:
       Questions or bug reports are welcome, please share it with user@ignite.apache.org. --> Please send your questions and bug reports to user@ignite.apache.org.

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
 | The node where read operation is executed.
 It can be either the primary or backup node (the latter case is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]).

Review comment:
       is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups is enabled]). maybe --> is only possible when link:configuring-caches/configuration-overview#readfrombackup[reading from backups] is enabled).

##########
File path: docs/_docs/events/events.adoc
##########
@@ -128,7 +128,7 @@ Cache events are also generated when you use DML commands.
 
 | EVT_CACHE_OBJECT_READ
 | An object is read from a cache.
-This event is not emitted when you use link:key-value-api/using-scan-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).
+This event is not emitted when you use link:key-value-api/using-cache-queries[scan queries] (use <<Cache Query Events>> to monitor scan queries).

Review comment:
       same as Line 108

##########
File path: docs/_docs/distributed-computing/collocated-computations.adoc
##########
@@ -105,7 +105,7 @@ tab:C++[unsupported]
 ====
 [discrete]
 === Performance Considerations
-Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-scan-queries[scan query] may perform better.
+Colocated computations yield performance benefits when the amount of the data you want to process is sufficiently large. In some cases, when the amount of data is small, a link:key-value-api/using-cache-queries[scan query] may perform better.

Review comment:
       the link is about cache queries, but the alt text is still 'scan query'

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.

Review comment:
       then applies a filter on them. --> then applies a filter to them.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.

Review comment:
       joined
   
   Also it is possible --> it is also possible

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and

Review comment:
       match --> matches

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry

Review comment:
       `IndexQuery` also supports an optional predicate the same as `ScanQuery` have. --> `IndexQuery` also supports an optional predicate, the same as `ScanQuery` has.

##########
File path: examples/src/main/java/org/apache/ignite/examples/model/Person.java
##########
@@ -51,7 +54,7 @@
     public String resume;
 
     /** Salary (indexed). */
-    @QuerySqlField(index = true)
+    @QuerySqlField(index = true, orderedGroups = @QuerySqlField.Group(name = ORG_SALARY_IDX, order = 1))
     public double salary;
 
     /** Custom cache key to guarantee that person is always collocated with its organization. */

Review comment:
       'collocated' was previously spelled as 'colocated'. Please review.

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"
+operations, or fields that aren't part of the index.

Review comment:
       that aren't part --> that are not the part

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.

Review comment:
       self --> itself
   
   by specified --> using specified

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the

Review comment:
       performs --> is performed
   
   If also index name isn't specified --> If index name is also not specified

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.

Review comment:
       perform ---> are performed

##########
File path: modules/core/src/main/java/org/apache/ignite/cache/query/IndexQuery.java
##########
@@ -29,12 +29,15 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Index query runs over internal index structure and returns cache entries for index rows.
+ * Index queries perform over distributed indexes and retrieve cache entries that match the specified criteria.
+ * {@code QueryCursor} delivers sorted cache entries by the order defined for queried index.
  *
  * {@code IndexQuery} has to be initialized with cache value class or type. The algorithm of discovering index is as following:

Review comment:
       as following --> as follows

##########
File path: docs/_docs/key-value-api/using-cache-queries.adoc
##########
@@ -118,7 +119,64 @@ include::code-snippets/cpp/src/scan_query.cpp[tag=set-local,indent=0]
 ----
 --
 
+== Executing Index Queries
+
+[WARNING]
+====
+[discrete]
+Experimental API. Introduced since Apache Ignite 2.12. Only Java API is supported. Questions or bug reports are welcome,
+please share it with user@ignite.apache.org.
+====
+
+Index queries perform over distributed indexes and retrieve cache entries that match the specified query. `QueryCursor`
+delivers sorted cache entries by the order defined for queried index. `IndexQuery` can be used if a low amount of data
+match filtering criteria. For such cases, `ScanQuery` usage is not optimal: it firstly extracts all cache entries and
+then applies a filter on them. `IndexQuery` relies on index tree structure and filters most of the entries without extracting.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQry,indent=0]
+----
+
+Index query criteria are defined in `IndexQueryCriteriaBuilder`. The goal of the criteria is to build a valid range to
+traverse the index tree. For this reason, criteria fields have to match the specified index. For example, if there is an
+index defined with (A, B) set, then valid criteria sets are (A) and (A, B). Criteria with the single (B) field are invalid
+because the field (B) is not a prefix set of the specified index fields, and it's impossible to build a narrow index range
+with it.
+
+[NOTE]
+====
+Criteria are joint by the AND operator. Also it is possible to use multiple criteria for the same field.
+====
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryMultipleCriteria,indent=0]
+----
+
+The index name is an optional parameter. In this case, Ignite tries to figure out the index by self by specified criteria fields.
+
+[source,java]
+----
+include::{javaFile}[tag=idxQryNoIdxName,indent=0]
+----
+
+For the empty criteria list, a full scan of the specified index performs. If also index name isn't specified, then the
+PrimaryKey index is used.
+
+=== Additional filtering
+
+`IndexQuery` also supports an optional predicate the same as `ScanQuery` have. It's suitable for additional cache entry
+filtering in such cases when a filter doesn't match an index tree range. For example, it contains some logic, the "OR"

Review comment:
       in such cases --> in cases




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org