On Mon, Sep 14, 2009 at 21:15, Michael Shoener
<[email protected]> wrote:
> Is there any way to query my custom mixin (hfs:file) and still be able to
> pull back the default jcr:content information?
>
> The default query (which searches the entire node contents and all
> properties):
>
> //element(*, nt:file)[jcr:contains(jcr:content, 'text to
> query')]/rep:excerpt(.)
>
> The query I am using (which searches only the @hfs:description and
> @hfs:formname priperties):
>
> //element(*, hfs:file)[jcr:contains(@hfs:description, 'text to
> query') or jcr:contains(@hfs:formname, 'text to query')]/(@hfs:description |
> @hfs:formname)
>
> I also want to be able to search on jcr:content and return the same
> information that the default search returns, plus my @hfs:description and
> @hfs:fromname values, if possible.
Do you mean you want to get both the excerpt (the rep:excerpt() in
your default query) and the single properties you mention?
In this case you simply run
//element(*, hfs:file)[jcr:contains(@hfs:description, 'text to query')
or jcr:contains(@hfs:formname, 'text to query')]
use the row iterator in the results and fetch both the properties via
row.getValue("hfs:description") and the excerpt via
row.getValue("rep:excerpt(.)"). The rep:excerpt function can be used
in both places - in the query and on the result set.
Regards,
Alex
--
Alexander Klimetschek
[email protected]