Oak indexing - remove one property from index | Community
Skip to main content
MikolajBuda
Level 2
January 15, 2018

Oak indexing - remove one property from index

  • January 15, 2018
  • 2 replies
  • 2486 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

edubey
Level 10
January 15, 2018

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

MikolajBuda
Level 2
January 15, 2018

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.

joerghoh
Adobe Employee
Adobe Employee
January 15, 2018

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

MikolajBuda
Level 2
January 16, 2018

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.

joerghoh
Adobe Employee
Adobe Employee
January 16, 2018

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.