Hi Pragya,

When you say you are “unable to search within that doc,” I am guessing you mean 
that a search that you think should match that doc is returning empty, is that 
right?

Search uses stemmed search by default, and a stemmed search is a language-aware 
search.  Each cts:query leaf constructor takes a lang=<lang> option, and that 
option specifies which language to look for the term(s) in the query.  By 
default, a search uses the default set on the database, which defaults to “en” 
(English).  

The language is determined by the xml:lang attribute.  So if you have Austrian 
language data, your XML might look like this:

<my-element xml:lang="at">
    <p>this text is tokenized in the in-scope xml:lang, which is "at" in this 
case.</p>
</my-element>

To search for this, you must specify the "lang=at" option in your cts:query.  
For example, the following demonstrates how this works:

xquery version "1.0-ml";
let $x := <my-element xml:lang="at">
    <p>this text is tokenized in the in-scope xml:lang, which is "at" in this 
case.</p>
</my-element>
return (
cts:contains($x/p, cts:word-query("this text")),
cts:contains($x/p, cts:word-query("this text", "lang=at"))
)

This returns false for the first one (because it defaults to lang=en) and true 
for the second one.

If you are using the search API, you can specify term-options to add your 
lang=at option.

For more info about languages in MarkLogic, see the Search Developer Guide 
(http://developer.marklogic.com/pubs/4.1/books/search-dev-guide.pdf), chapters 
17 and 18.

Hopefully that will get you started.

-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Pragya Kapoor
Sent: Thursday, July 01, 2010 11:05 PM
To: [email protected]
Subject: [MarkLogic Dev General] Query on multiple language

Hi ,

I have a Austria data which I have loaded in ML.
But I am unable to search within that doc.
Do I need to do any additional settings for language other than English.

Thanks,
Pragya

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

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

Reply via email to