Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Custom Indexing with queryPaths list vs includePaths list

Avatar

Level 7

Hi Team

 

Can I know the usage of Custom Indexing with queryPaths list.

What is the deference between queryPaths list vs includePaths list ? 

Is it we can use for both property indexing and lucene indexing ?

 

Thanks ! 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @JakeCham,

Below are the definitions from official documentation:

  • includedPaths - defines list of paths which should be included in the index.
  • queryPaths - defines list of paths for which the index can be used to perform queries.

So the main difference is that includedPaths will affect the index size and it scope in terms of paths that will be take into account during indexing process. queryPaths is considered by query engine, executing query, checking if specific index should be used to run given query, base on path(s) configured in queryPaths property. In other words, if you need to ensure that a given index only gets used for query with specific path restrictions then you need to specify those paths.

As per documentation you should use includedPaths and queryPaths together.

Please check nice usage example, presented in the documentation: https://jackrabbit.apache.org/oak/docs/query/lucene.html#query-paths

Looking into property index documentation, it seems that only includedPaths is supported for this type of index https://jackrabbit.apache.org/oak/docs/query/property-index.html

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi @JakeCham,

Below are the definitions from official documentation:

  • includedPaths - defines list of paths which should be included in the index.
  • queryPaths - defines list of paths for which the index can be used to perform queries.

So the main difference is that includedPaths will affect the index size and it scope in terms of paths that will be take into account during indexing process. queryPaths is considered by query engine, executing query, checking if specific index should be used to run given query, base on path(s) configured in queryPaths property. In other words, if you need to ensure that a given index only gets used for query with specific path restrictions then you need to specify those paths.

As per documentation you should use includedPaths and queryPaths together.

Please check nice usage example, presented in the documentation: https://jackrabbit.apache.org/oak/docs/query/lucene.html#query-paths

Looking into property index documentation, it seems that only includedPaths is supported for this type of index https://jackrabbit.apache.org/oak/docs/query/property-index.html