wildcard cts:element-value-query is not behaving as expected.
insert doc query:
xdmp:document-insert('/sample/2.xml', <data>the living Theater</data>)
cts query:
cts:search(
doc(),
cts:element-value-query(xs:QName('data'), 'theater* *', ('wildcarded', 'case-insensitive', 'unstemmed', 'punctuation-sensitive', 'whitespace-sensitive')),
'unfiltered'
)
Above cts query is returning me the /sample/2.xml document. As per my understanding this query should not return the above document it should return only the docs starting with theater text.
seems like the issue is with the below text pattern.
present text in document : @@@ word @@@text
search term: @@@t* *
@ - can be any character.
I am able to reproduce the problem with the below data as well.
present text in doc: mark the marklogic
search text: markl* *
wildcard related indexes are set to true.
I have pasted the database configuration, it might help in finding the problem.
Database configuration:
<package-database xmlns="http://marklogic.com/manage/package/databases">
<config>
<name>publishers</name>
<package-database-properties>
<enabled>true</enabled>
<retired-forest-count>0</retired-forest-count>
<language>en</language>
<stemmed-searches>advanced</stemmed-searches>
<word-searches>true</word-searches>
<word-positions>true</word-positions>
<fast-phrase-searches>true</fast-phrase-searches>
<fast-reverse-searches>false</fast-reverse-searches>
<triple-index>true</triple-index>
<triple-positions>true</triple-positions>
<fast-case-sensitive-searches>true</fast-case-sensitive-searches>
<fast-diacritic-sensitive-searches>true</fast-diacritic-sensitive-searches>
<fast-element-word-searches>true</fast-element-word-searches>
<element-word-positions>true</element-word-positions>
<fast-element-phrase-searches>true</fast-element-phrase-searches>
<element-value-positions>true</element-value-positions>
<attribute-value-positions>true</attribute-value-positions>
<field-value-searches>true</field-value-searches>
<field-value-positions>true</field-value-positions>
<three-character-searches>true</three-character-searches>
<three-character-word-positions>true</three-character-word-positions>
<fast-element-character-searches>true</fast-element-character-searches>
<trailing-wildcard-searches>true</trailing-wildcard-searches>
<trailing-wildcard-word-positions>true</trailing-wildcard-word-positions>
<fast-element-trailing-wildcard-searches>true</fast-element-trailing-wildcard-searches>
<word-lexicons>
<word-lexicon>http://marklogic.com/collation/codepoint</word-lexicon>
</word-lexicons>
<two-character-searches>false</two-character-searches>
<one-character-searches>false</one-character-searches>
<uri-lexicon>true</uri-lexicon>
<collection-lexicon>true</collection-lexicon>
<reindexer-enable>true</reindexer-enable>
<reindexer-throttle>5</reindexer-throttle>
<reindexer-timestamp>0</reindexer-timestamp>
<directory-creation>manual</directory-creation>
<maintain-last-modified>false</maintain-last-modified>
<maintain-directory-last-modified>false</maintain-directory-last-modified>
<inherit-permissions>false</inherit-permissions>
<inherit-collections>false</inherit-collections>
<inherit-quality>false</inherit-quality>
<in-memory-limit>174080</in-memory-limit>
<in-memory-list-size>341</in-memory-list-size>
<in-memory-tree-size>85</in-memory-tree-size>
<in-memory-range-index-size>11</in-memory-range-index-size>
<in-memory-reverse-index-size>11</in-memory-reverse-index-size>
<in-memory-triple-index-size>44</in-memory-triple-index-size>
<large-size-threshold>1024</large-size-threshold>
<locking>fast</locking>
<journaling>fast</journaling>
<journal-size>682</journal-size>
<journal-count>2</journal-count>
<preallocate-journals>false</preallocate-journals>
<preload-mapped-data>false</preload-mapped-data>
<preload-replica-mapped-data>false</preload-replica-mapped-data>
<range-index-optimize>facet-time</range-index-optimize>
<positions-list-max-size>256</positions-list-max-size>
<format-compatibility>automatic</format-compatibility>
<index-detection>automatic</index-detection>
<expunge-locks>none</expunge-locks>
<tf-normalization>scaled-log</tf-normalization>
<merge-priority>lower</merge-priority>
<merge-max-size>32768</merge-max-size>
<merge-min-size>1024</merge-min-size>
<merge-min-ratio>2</merge-min-ratio>
<merge-timestamp>0</merge-timestamp>
<retain-until-backup>false</retain-until-backup>
<assignment-policy-name>bucket</assignment-policy-name>
</package-database-properties>
</config>
</package-database>
'filtered'option? - Mads Hansenelement word positionis set to true. Still the same problem. Tried adding the word lexicon withhttp://marklogic.com/collation/codepointcollation but no gain. - Dixit Singlavaluequery is behaving aswordquery - Dixit Singla