I am trying to fetch auto suggestions with a specified custom index and getting null results.I really appreciate your thoughts on it.
SELECT [rep:suggest()] FROM [cq:Page] WHERE SUGGEST('tes') OPTION(INDEX NAME [testindex])
Tried lot of select queries but anything with specific index name giving 0 results but with OTB cqPageLucene giving results.
<testindex
jcr:primaryType="oak:QueryIndexDefinition"
async="[async,nrt]"
compatVersion="{Long}2"
evaluatePathRestrictions="{Boolean}true"
excludedPaths="[/var,/etc/replication,/etc/workflow/instances,/jcr:system]"
includedPaths="[/content/test]"
queryPaths="/content/test"
reindex="{Boolean}false"
reindexCount="{Long}17"
seed="{Long}-3675128066810099332"
type="lucene">
<aggregates jcr:primaryType="nt:unstructured">
<cq:Page jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="jcr:content"
relativeNode="{Boolean}true"/>
</cq:Page>
<nt:file jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="jcr:content"/>
</nt:file>
<cq:PageContent jcr:primaryType="nt:unstructured">
<include0
jcr:primaryType="nt:unstructured"
path="*"/>
<include1
jcr:primaryType="nt:unstructured"
path="*/*"/>
<include2
jcr:primaryType="nt:unstructured"
path="*/*/*"/>
<include3
jcr:primaryType="nt:unstructured"
path="*/*/*/*"/>
</cq:PageContent>
</aggregates>
<indexRules jcr:primaryType="nt:unstructured">
<cq:Page jcr:primaryType="nt:unstructured">
<properties jcr:primaryType="nt:unstructured">
<cqLastModified
jcr:primaryType="nt:unstructured"
name="jcr:content/cq:lastModified"
ordered="{Boolean}true"
propertyIndex="{Boolean}true"
type="Date"/>
<jcrTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/jcr:title"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
<pageTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/pageTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
<navTitle
jcr:primaryType="nt:unstructured"
name="jcr:content/navTitle"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
<nodeName
jcr:primaryType="nt:unstructured"
name=":nodeName"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
<cqLastRolledoutBy
jcr:primaryType="nt:unstructured"
name="jcr:content/cq:lastRolledoutBy"
propertyIndex="{Boolean}true"
type="String"/>
<location
jcr:primaryType="nt:unstructured"
name="jcr:content/location"
notNullCheckEnabled="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"/>
<jcrDesc
jcr:primaryType="nt:unstructured"
name="jcr:content/jcr:description"
nodeScopeIndex="{Boolean}true"
propertyIndex="{Boolean}true"
type="String"
useInSpellcheck="{Boolean}true"
useInSuggest="{Boolean}true"/>
</properties>
</cq:Page>
</indexRules>
<suggestion
jcr:primaryType="nt:unstructured"
suggestAnalyzed="{Boolean}true"
suggestUpdateFrequencyMinutes="{Long}1"/>
</testindex>