Is it possible to select a lucene index to perform queries?
Hello,
I'm currently working with AEM 6.2 and I would like to know if I can select (deliberately) a lucene index to perform different queries. For example, imagine 2 different teams working on these paths:
- TeamA works on /content/dam/stuff and defined an index named TAIndex
- TeamB works on /content/dam/stuff/tbStuff and defined its own index named TBIndex
Depending on the index cost, path restrictions, filters... TeamA could be performing queries against TBIndex and thus getting an invalid response. So, I would like to make TeamA always work with TAIndex and TeamB work with TBIndex.
Different options come to mind:
- Add two new fields to every asset (e.g. belongsTA and belongsTB). Thus all the documents in TAIndex will include belongsTA and every TeamA query will include the clause belongsTA:true (the same for TeamB). I don't like it much as it implies new fields that need to be managed, bigger index and extra filter.
- Use lucene native queries (I wasn't able to make them work in AEM :( ).
Any help is appreciated.
Regards.