Custom Indexing with queryPaths list vs includePaths list | Community
Skip to main content
JakeCham
Level 6
December 27, 2023
Solved

Custom Indexing with queryPaths list vs includePaths list

  • December 27, 2023
  • 1 reply
  • 613 views

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 ! 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by lukasz-m

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

1 reply

lukasz-m
Community Advisor
lukasz-mCommunity AdvisorAccepted solution
Community Advisor
December 27, 2023

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