Thanks Danny and Mike! These are both great clues for me to pursue.

Regards,

Stuart


On Sun, Jul 1, 2012 at 1:15 PM, Michael Blakeley <m...@blakeley.com> wrote:

> Sorry for the terseness: I was replying from my phone.
>
>
> http://docs.marklogic.com/5.0doc/docapp.xqy#display.xqy?fname=http://pubs/5.0doc/xml/admin/fields.xmlhas
>  the docs for database field configuration.
>
> -- Mike
>
> On 1 Jul 2012, at 10:04 , Danny Sokolsky wrote:
>
> > I think Mike was probably guessing that you wanted to search just the
> text nodes you specified in that cts:query, hence suggesting a field.
> >
> > If you want to search all text nodes, that is what cts:word-query will
> do, and it is the default query when using cts:search (or search:search).
>  So the following searches for the word "hello" in all text nodes in the
> database:
> >
> > cts:search(fn:collection(), "hello")
> >
> > and is equivalent to the following:
> >
> > cts:search(fn:collection(), cts:word-query("hello"))
> >
> > -Danny
> >
> > ________________________________________
> > From: general-boun...@developer.marklogic.com [
> general-boun...@developer.marklogic.com] On Behalf Of Stuart Myles [
> stuart.my...@gmail.com]
> > Sent: Sunday, July 01, 2012 8:42 AM
> > To: MarkLogic Developer Discussion
> > Subject: Re: [MarkLogic Dev General] How to Query Attributes *and* All
> Text Nodes via search:search?
> >
> > Hi Mike,
> >
> > Can you expand on this idea at all? What kind of field? Any pointers as
> to where in the database config I might set up such a field?
> >
> > Also, does anyone know how it is that search:search is able to search
> all text nodes by default, but I can't configure a cts:search to do that?
> Seems odd, if true.
> >
> > Regards,
> >
> > Stuart
> >
> >
> > On Fri, Jun 29, 2012 at 3:25 PM, Michael Blakeley <m...@blakeley.com
> <mailto:m...@blakeley.com>> wrote:
> > Might be a good job for a field, in the database config.
> >
> > -- Mike
> >
> > On Jun 29, 2012, at 8:48, Stuart Myles <stuart.my...@gmail.com<mailto:
> stuart.my...@gmail.com>> wrote:
> >
> > By default, terms entered into search:search() simply search all text
> nodes of a document, as explained in:
> >
> > http://community.marklogic.com/try/ninja/page13
> >
> > What I'd like to do is to query certain attributes and all the text
> nodes in my document. But, ideally, I don't want to list all of the text
> nodes, since there are so many of them (and we might add more).
> >
> > To make my question more concrete, here's the cts:or-query from the
> above "Extending the Search API" "ninja" article:
> >
> > <cts:or-query qtextconst="{ $token }">
> >    { cts:element-attribute-word-query(xs:QName("message"),
> >         xs:QName("list"), string($token), $options, 2.5) }
> >    { cts:element-attribute-word-query(xs:QName("attachment"),
> >         xs:QName("file"), string($token), $options, 3) }
> >    { cts:element-attribute-word-query(xs:QName("from"),
> >         xs:QName("personal"), string($token), $options, 3) }
> >    { cts:element-attribute-word-query(xs:QName("from"),
> >         xs:QName("address"), string($token), $options, 3) }
> >    { cts:element-word-query(xs:QName("subject"), string($token),
> >         $options, 2) }
> >    { cts:element-word-query(xs:QName("para"), string($token),
> >         $options, 1) }
> >    { cts:element-word-query(xs:QName("attachpara"), string($token),
> >         $options, 0.75) }
> >    { cts:element-word-query(xs:QName("quotepara"), string($token),
> >         $options, 0.5) }
> >  </cts:or-query>
> >
> > What if, rather than listing each of the QNames for subject, para,
> attachpara and quotepara I wanted to just say "query all text nodes" (and
> given them all the same score weight, of course)? Is it doable?
> >
> > Thanks in advance,
> >
> > Stuart
> >
> > _______________________________________________
> > General mailing list
> > General@developer.marklogic.com<mailto:General@developer.marklogic.com>
> > http://developer.marklogic.com/mailman/listinfo/general
> >
> > _______________________________________________
> > General mailing list
> > General@developer.marklogic.com<mailto: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
> >
>
> _______________________________________________
> 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

Reply via email to