#SB-246: Sort out the issue with the indexing of pom files

- Extracted a query creation method.