Highlighted

Oak indexing - remove one property from index

MikolajBuda

15-01-2018

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.

Replies

Highlighted
Highlighted

MikolajBuda

15-01-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.

Highlighted

Jörg_Hoh

Employee

15-01-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

Highlighted

MikolajBuda

16-01-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.

Highlighted

Jörg_Hoh

Employee

16-01-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.

Highlighted

MikolajBuda

17-01-2018

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.