Full-text Search Suggestion AEM 6.0 | Community
Skip to main content
salvadorm142499
New Participant
February 20, 2016
Solved

Full-text Search Suggestion AEM 6.0

  • February 20, 2016
  • 8 replies
  • 5047 views

Hi all,

I am trying to achieve predictive search (suggestions) on AEM 6.0 with Apache Jackrabbit Oak 1.0.22. Following OAK documentation, since Oak 1.0.15, we are able to find suggestions for a given query by using Apache Lucene. Moreover, I have created an extra index to able full-text search with suggestion on the jcr:description property (see picture):

I have a page whose jcr:description is "This is my query word within the page description"

My back-end code is something like that:

            QueryManager qm = session.getWorkspace().getQueryManager();
            String query = "SELECT [rep:suggest()] FROM nt:base WHERE [jcr:path] = '/content/myproject' AND SUGGEST('query')";
            Query searchQuery = qm.createQuery(query, Query.SQL);
            RowIterator it = searchQuery.execute().getRows();

I get no results and the logs shows: org.apache.jackrabbit.oak.query.ast.SuggestImpl No full-text index was found that can process the condition suggest([nt:base], cast('query' as string))

However, if I query like that:

        queryMap.put("fulltext", "query");
        queryMap.put("path", "/content/myproject");
        final QueryBuilder queryBuilder = resourceResolver.adaptTo(QueryBuilder.class);
        return queryBuilder.createQuery(PredicateGroup.create(queryMap), session);

I get result -> the page with the description.

Could anybody give me a clue about why the suggestion query is not working? Why doesn't OAK find full-text indexes if there are two of them, the OOTB 'lucene' and the custom one 'lucene-suggestion' created by me?

Many thanks, Salvador.

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 Gokul2011

Do you verified  description from below URL

http://www.aemstuff.com/blogs/feb/aemindexcheatsheat.html

8 replies

New Participant
August 30, 2017

Hi All,

I am also getting the same error. Could anyone let me know if you have the resolution for this.

Thanks,

Mayur

New Participant
May 10, 2016

Hi Salvador,

I am also getting the same issue with AEM 6.0 SP3. Did you find any fix for the same?

Thanks

Ravinder

salvadorm142499
New Participant
February 22, 2016

Hi Amit,

As Sumantap said, the word 'query' was an example. It should be the user input. It throws this log all the time:

org.apache.jackrabbit.oak.query.ast.SuggestImpl No full-text index was found that can process the condition suggest([nt:base], cast('keyword' as string))

Cheers,

Salvador

salvadorm142499
New Participant
February 22, 2016

Hi Gokul,

Thanks for this link, the index cheatsheat is great. Following this instructions, this is the new index created:

The jcr:description node has the following properties:

           
1
analyzed
Boolean
true
false
false
false
false
           
2
index
Boolean
true
false
false
false
false
           
3
jcr:primaryType
Name
nt:unstructured
true
true
false
true
           
4
name
String
jcr:description
false
false
false
false
       
5
useInSuggest
Boolean
true

However, I still have no result and the logs keep showing:

org.apache.jackrabbit.oak.query.ast.SuggestImpl No full-text index was found that can process the condition suggest([nt:base], cast('keyword' as string))

Why OAK does not find a full-text index if a lucene index has been created?!

New Participant
February 22, 2016

Its a problem with keyword  SUGGEST('any query value you may like to suggest')

Amit_Kumar
New Participant
February 22, 2016

Can you test this for any other word but query?

New Participant
February 21, 2016

i'm also getting the same issue with Oak 1.0.15, please let me know if you are able to resolve this issue.

Gokul2011Accepted solution
New Participant
February 21, 2016

Do you verified  description from below URL

http://www.aemstuff.com/blogs/feb/aemindexcheatsheat.html