And you should be able to express that with the value query by making your wildcarded expression something like:
dev* * The first star means matches zero or more chars in that word, and the second * means matches zero or more words in the value. So that could match the following values: developer world devops but would not match: a developer’s world -Danny From: [email protected] [mailto:[email protected]] On Behalf Of Lanz Sent: Monday, May 11, 2015 7:54 AM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] wildcarded search with cts:field-value-query Hi Florent, Thanks I understand the difference, actually we want to match word (and part of word) wherever they it is located in the value of the field. The cts:field-word-query is the right option in our case. Regards Lancelot On Mon, May 11, 2015 at 1:11 PM, Florent Georges <[email protected]<mailto:[email protected]>> wrote: Hi Lancelot, Is the text you try to match the entire value of the element it is part of? Like the difference between: <title>Development is ...</title> and: <title>The development is ...</title> In the first case, it will match both queries (thanks to the wildcard at the end of the search term). In the second case, it will match only the word search (which matches words as in a search engine), not the value search (which matches elements values, like entire values). Regards, -- Florent Georges http://fgeorges.org/ http://h2oconsulting.be/ On 11 May 2015 at 12:47, Lanz wrote: > hi all, > > I'm facing an issue using cts:field-value-query with wildcarded search in ML > 7.0-5 > Following search should match any field starting with 'dev' like > development, etc. > > let $term := 'dev' > return > cts:search( > fn:collection()/l:manifestation[l:issn], > cts:field-value-query( > 'field-quick-search', > $term || '*', > ('case-insensitive', 'diacritic-insensitive', 'unstemmed', > 'wildcarded') > ) > ) > But its returns nothing > > Fields 'field-quick-search' seems to be well configured to work with > wildcarded search: > Name: field-quick-search > Path: *:title, *:subTitle, *:doiSuffix, *:code, *:userCode, *:issn, @id > Includes: work, expression, manifestation > Excludes (nothing) > Index Settings: +word, +fast phrase, +fast case sensitive, +fast diacritic > sensitive, +trailing wildcard, +three character, +two character > > The same search with cts:field-word-query works : > let $term := 'dev' > return > cts:search( > fn:collection()/l:manifestation[l:issn], > cts:field-word-query( > 'field-quick-search', > $term || '*', > ('case-insensitive', 'diacritic-insensitive', 'unstemmed', > 'wildcarded') > ) > ) > > Any thoughts on what I might be doing wrong? > Thanks > Lancelot > > _______________________________________________ > General mailing list > [email protected]<mailto:[email protected]> > Manage your subscription at: > http://developer.marklogic.com/mailman/listinfo/general > _______________________________________________ General mailing list [email protected]<mailto:[email protected]> Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
