Expand my Community achievements bar.

Oak Index configuration for query with fulltext as well as property based filtering

Avatar

Level 2

We have a requirement wherein, we want to index all the properties(including cq:tags) for full text and then filter the results based on cq:tags. Below is the oak index definition that we use.

- compatVersion = 2

  - type = "lucene"

  - async = "async"

  - jcr:primaryType = oak:QueryIndexDefinition

  + indexRules

   + nt:base

    + properties

     + prop1

      - name = "jcr:content/metadata/cq:tags"

      - propertyIndex = true

     + prop0

      - name = "jcr:content/cq:tags"

      - propertyIndex = true

Query:

1_group.1_property=jcr:content/cq:tags

1_group.1_property.value=geometrixx:title%

1_group.1_property.operation=like

1_group.2_property=jcr:content/metadata/cq:tags

1_group.2_property.value=geometrixx:title%

1_group.2_property.operation=like

1_group.p.or=true

2_fulltext=abc

With this index, when I search with a keyword say “abc”,  the search results are returned such that they don’t  return the results where cq:tags contains this key word “abc”. Is there a way to include cq:tags for both fulltext indexing as well as for filtering the results based on property.

In other words, can i have a property which can participate in both fulltext indexing as well as property indexing for a single index(single query). If so, how we have to configure the same.

0 Replies