You searched for the phrase "Rented House" so it's correct that only the first 
instance matched.  The second doesn't contain that phrase.  Wildcarding has 
nothing to do with it, because you're not using * or ? wildcard characters.

You can do:

cts:and-query((
  cts:element-word-query(xs:QName("title"), "rented", "case-insensitive"),
  cts:element-word-query(xs:QName("title"), "house", "case-insensitive"),
)

This will match docs that have both words in a title.  Order doesn't matter.  
Of course "rented" and "rents" aren't exactly the same word.  If you have 
stemming on and they stem the same then they'll match.  Will they stem the 
same?  Probably.  I always have to check on specific words to see what stemming 
selection matches.  You can also do rent* as a wildcarded term, which is where 
wildcarding would come in.

You could also do cts:element-query() which has somewhat different 
characteristics, using positions to make sure the words are in the same title 
element.  That might be handy if docs have a lot of title elements but 
unnecessary otherwise.

-jh-

On May 30, 2010, at 9:07 PM, Pragya Kapoor wrote:

> Hi,
>  
> I am using the below query:
>  
> Let $search := “Rented House”
> cts:element-word-query(xs:QName("title"),$search,("case-insensitive", 
> "wildcarded"))
>  
> DATA has title as:
> 1.       Rented house in delhi
> 2.       House Rents are high
>  
> Now the above query does not give the second result.
> I have to frame my query in such a way that it should give me results even if 
> the wildcard query(more than one term) is in any order.
>  
> 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

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

Reply via email to