Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Oak indexing - remove one property from index

Avatar

Level 2

Hello,

I have following configuration:

{

   "jcr:primaryType":"oak:QueryIndexDefinition",

   "compatVersion":2,

   "name":"cq:Page",

   "type":"lucene",

   "async":"async",

   "reindex":false,

   "reindexCount":4,

   "aggregates":{

      "jcr:primaryType":"nt:unstructured",

      "cq:Page":{

         "jcr:primaryType":"nt:unstructured",

         "include0":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":true,

            "path":"jcr:content"

         }

      },

      "nt:file":{

         "jcr:primaryType":"nt:unstructured",

         "include0":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":false,

            "path":"jcr:content"

         }

      },

      "cq:PageContent":{

         "jcr:primaryType":"nt:unstructured",

         "include0":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":false,

            "path":"*"

         },

         "include1":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":false,

            "path":"*/*"

         },

         "include2":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":false,

            "path":"*/*/*"

         },

         "include3":{

            "jcr:primaryType":"nt:unstructured",

            "relativeNode":false,

            "path":"*/*/*/*"

         }

      }

   },

   "indexRules":{

      "jcr:primaryType":"nt:unstructured",

      "cq:Page":{

         "jcr:primaryType":"nt:unstructured",

         "properties":{

            "jcrCreated":{

               "jcr:primaryType":"nt:unstructured",

               "nodeScopeIndex":false,

               "propertyIndex":false,

               "analyze":false,

               "name":"jcr:content/jcr:created",

               "type":"Date",

               "index":false,

               "excludeFromAggregation":true

            }

         }

      }

   }

}

However when using search engine still matches with values which are under jcr:created. Is something wrong with this configuration?
It seems the OAK version is 1.2.2 (assumed from OSGi bundles) and AEM is 6.0.

6 Replies

Avatar

Level 10

By "search engine" are you referring to search query in AEM or some external search engine like google...?

Avatar

Level 2

It is a custom component which executes JCR query built from PredicateGroup. PredicateGroup uses entered text as fulltext property and looks for results in cq:page types.

Avatar

Employee Advisor

If you have Oak 1.2.2 you are running AEM 6.1 without any service pack. You should change that.

What query do you want to improve with this index definition?

kind regards,

Jörg

Avatar

Level 2

The problem is, I do not want to improve anything. I just would like not getting results where page is found as a search result when search text matches eg. milliseconds from cq:lastModified property.

Avatar

Employee Advisor

Hi,

ok, you do strange queries then 🙂

Anyway, for your index to get picked you need to explicitly exclude a match on jcr:Created; and even then I am not sure if the query engine can handle that.

Avatar

Level 2

Hi,

I will explain once again what I would like to achieve beacuse I believe we don't undestand each other.

Right now I have configured jcr:created under cq:Page node to be indexed for search. If jcr:created contains eg: value: "123" and I type it in search box, I will get that specific page. I would rather like to exclude it from "contains" search if it is possible, so I will not get this particular page as a search result if search text matches with jcr:created node value.