AEM 6.4 OOTB Suggestions index configuring

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

14-06-2019

Hi! I'm in bit of a dead end, and what i've read in the documentation here has not helped me much.

I'm using the suggester OOTB service to get results, and right now  it's working but it's fetching suggestions from all kinds of different unwanted places.

The server on which this AEM instance will run will host multiple projects, so I need to have it suggest stuff only from my project, "content/myProject1".

It's currently suggesting from "content/myProject1", "content/myProject2", "content/myProject3" and so on.

I've went to oak-index and opened the cq:PageLucene, and I tried the following:

  • added content/myProject1 as an object in multistring queryParams
  • added content/myProject1 in queryParams and includedPaths too
  • added content/myProject2 in excludedPaths

After each change I reindexed and tried again. No matter which route I go on, and for no matter what input I give, i only get an empty array as a response. That can't be right, and i'm not sure what am I doing wrong.

Any tips are greatly appreciated,

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

berliant

Employee

Avatar

berliant

Employee

berliant
Employee

14-06-2019

cqPageLucene index /oak:index/cqPageLucene/indexRules/cq:Page is indexing all cq:Page type of node in JCR. It means that page in all projects that you are hosting in AEM will be indexed. There is not needs to add paths to projects.

That been said, it's unclear what is your overall goal. Are you using queries that are leveraging some custom properties, and that is why you are in need to update cqPageLucene?

If this is the case, you can paste your query into Oak Utilities : Index Definition Generator

The tool will generate a hint for a custom index if's required.

Also,  you can reveiw Oak Queries and Indexing 

Answers (3)

Answers (3)

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

24-06-2019

I've accepted your answer because it's full of valuable info, even if it's not exactly for my problem.

To solve my problem I ended up writing a custom suggester service that uses a query to create the suggestions.

Thanks!

Avatar

Avatar

cristianb256715

Avatar

cristianb256715

cristianb256715

18-06-2019

Hello.

Firstly, thanks for your response.

My goal is to have the OOTB Suggester service return only suggestions from my project instead of all the projects from the server.

For that, I've tried about configuring the aforementioned cqPageLucene, but maybe I am going in this the wrong way?

That being said, i think i should only fine tune an existing index and have it search only under my content.

Server instance has two projects:

- project1

- project2

I want it to search for cqPage suggestions only from project1.

Avatar

Avatar

jbrar

Employee

Avatar

jbrar

Employee

jbrar
Employee

14-06-2019

In addition to what Leo mentioned, if you are talking about AEM Projects and not pages.

There is an index named "cqProjectLucene" that is used for any queries triggered on the "cq:Project" mixin type nodes. Example, when you go under the projects.html page and try to trigger a search, AEM will trigger the query below:

select [jcr:path], [jcr:score], * from [cq:Project] as a where contains(*, 'test') and isdescendantnode(a, '/content/projects')

Using the explain query tool[2] from AEM, I can see this query is using the "cqProjectLucene" index which has the lowest cost for this kind of query.

You can update that index as per your need