On Tue, 11 Mar 2014 20:53:52 -0700, Amit Kumar Dev <[email protected]> wrote:

> Hi All,
>
>
> *         I am performing one character wild card search on title element.
> i.e.
> <cts:element-query>
>                 <cts:element>Title</cts:element>
>                                 <cts:word-query weight="2">
>                                 <cts:text>D*</cts:text>
>                                 <cts:option>wildcarded</cts:option>
>                                 <cts:option>case-insensitive</cts:option>
>                                 <cts:option>stemmed</cts:option>
>                                 </cts:word-query>
> </cts:element-query>
>
>
> *         I am performing unfiltered search.
>
> *         Only Three & Two character wild card index is enable, but element 
> word lexicon for Title is not created.
>
> After performing search I get documents which has Title with Diamond, 
> Delegate etc.., but I am also getting documents which does not have any words 
> starting with D in Title element.
>
> My queries are:
>
> *         Is this behavior because of unfiltered search?
>
> *         What is the best possible way to achieve one character wild card 
> search without using filter search?

Look at what xdmp:plan shows you for this query. Since you
don't have any index capable of resolving the D* part of it,
you will just be asking the index for all documents containing
Title elements. Unfiltered search is search using only the
indexes.

In general we would recommend using 3 character plus a codepoint
word lexicon if you want to do wildcard queries. It may help to
add the trailing wildcard index as well. If you have the word
lexicon, the two-character index doesn't give you a lot.

Also note that and element-query containing a word-query is
not the same as an element-word-query, and to accurately
resolve the former you will need element and word positions.
(Difference being: <book><Title><BREAK>Dog</BREAK></Title></book>
matches the element-query, but not the element-word-query
unless BREAK is declared as an element-word-query-through.)

//Mary

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to