The simplest (and most efficient at query time) way to do this is to add an 
attribute on the title storing the simplified title, according to your 
simplification algorithm.

<title simple="Rented House Delhi">Rented House in Delhi</title>

Then when the user searches for "A rented house in delhi" you change that to 
its simplified form also, which is "rented house delhi".  Then you can easily 
and efficiently query for the simplified string matching the simplified 
title/@simple attribute.

-jh-

On Jun 4, 2010, at 4:13 AM, Pragya Kapoor wrote:

> Hi Danny,
> 
> I can't use the element-word-query in place of element-value-query as I have 
> to look for exact match ignoring the noise words.
> 
> Is it possible?
> 
> Thanks,
> Pragya
> 
> Date: Thu, 3 Jun 2010 17:17:46 -0700
> From: Danny Sokolsky <[email protected]>
> Subject: Re: [MarkLogic Dev General] Ignoring customized noise words
>       in element      value query
> To: General Mark Logic Developer Discussion
>       <[email protected]>
> Message-ID:
>       <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Hi Pragya,
> 
> If you are going to do this, I would not use an element-value-query.  There 
> is no concept of "noise words", and the phrase "rented house in delhi" does 
> not match "rented house delhi".  If you want that to match, I would use an 
> element-word-query instead and not pass it a phrase.  Something like:
> 
> cts:and-query((
>  let  $y := "Rented House in Delhi"
>  for $x in fn:tokenize($y, " ")
>  return 
>      cts:element-word-query(xs:QName("title"),$x)
> ))
> 
> 
> -Danny
> 
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of Pragya Kapoor
> Sent: Thursday, June 03, 2010 2:50 AM
> To: [email protected]
> Subject: [MarkLogic Dev General] Ignoring customized noise words in element 
> value query
> 
> Hi,
> 
> I have to ignore the noise words(this would be a list of words which I give) 
> in element value query.
> Eg:
> Rented house in Delhi(title)
> 
> Now user types in Rented House Delhi/Rented House in Delhi
> 
> Both query should give the result. So, how can I include such a query in my 
> additional query to make this work.
> 
> <additional-query>
> ????? ????? ??? { 
> ????? ????? ?????? 
> ????? ???????????????? cts:element-value-query(xs:QName("title"),$search, 
> ("case-insensitive","unstemmed"))
> ????? 
> ????? ????? ???? }
> </additional-query>
> 
> Please let me know how this can be achieved.
> 
> Thanks,
> Pragya
> 
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general

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

Reply via email to