Hi, I already try something like this but it return no result. Need I to provide a particular index to enable it ?
Thanks, Stéphane Le 9 sept. 2011 à 16:13, Colleen Whitney a écrit : > Also posted there... It's grammar-aware. You need to add quotes around the > phrase if you want to get suggestions on the phrase, otherwise it treats the > tokens separately. Try search:suggest('"Robert Lo"',$options). > > > ________________________________________ > From: general-boun...@developer.marklogic.com > [general-boun...@developer.marklogic.com] On Behalf Of Stephane Toussaint > [stephane.toussa...@4dconcept.fr] > Sent: Friday, September 09, 2011 5:54 AM > To: General MarkLogic Developer Discussion > Subject: [MarkLogic Dev General] Confused with search:suggest > > Hi, > > Sorry to cross-post this question (originally posted at > http://stackoverflow.com/questions/7271464/confused-with-searchsuggest), but > I can't always figure out how to achieve this : > > > I'm not able to provided this simple autocompletion feature with the help of > the search:suggest function. > > Based on the Oscars corpus from Marklogic Demo data, I try to provide a > suggest query which was for instance able to return "Robert Loggia" as an > answer even if the user is currently writing "Robert Lo" or "Loggia Rob" or > even "L Rob". > > Currently, I'm only able to return "Robert Loggia" amongst some of his peers > with this simple query : > > let $options := > <options xmlns="http://marklogic.com/appservices/search"> > <default-suggestion-source> > <range type="xs:string"> > <element ns="http://marklogic.com/wikipedia" name="name" /> > </range> > </default-suggestion-source> > </options> > return search:suggest("Rob",$options) > > > But as soon as I'm writing a two words phrase, I'm not sure to understand how > to write that, because none of the answer is correct with what I'm waiting. > For instance : > > search:suggest("Robert Lo",$options) > > > or > > search:suggest(("Robert", "Lo"),$options) > > > Is it due to missing option, indexes misconfiguration or a misused feature ? > > Thanks For Help > > Thanks, > Stéphane > > _______________________________________________ > General mailing list > General@developer.marklogic.com > http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general