[opencms-dev] Search index for picture description in photoalbum

Yves Glodt yg at mind.lu
Thu May 12 15:56:23 CEST 2011


Thanks Paul-Inge and Florian for the suggestions!

On 12 May 2011 13:14, Florian Hopf <hopf at synyx.de> wrote:

> Hi,
>
> Am 12.05.2011 11:17, schrieb Yves Glodt:
> > is it possible to create a search which will only search in the
> > description text of of a picture?
> >
> > Background: On a site I would like to add some tags into the description
> > field of the pictures in a photoalbum.
> >
> > Then I would like to create a search field wher people can search for
> > tags, and get the pictures which have the tag assigned.
> >
>
> This should be possible and even quite easy. CmsSearch provides a method
> to only search on certain fields and for a certain resource type. It
> should work like this:
>
> CmsSearch search = ...;
> search.addFieldQueryMust(CmsSearchField.FIELD_DESCRIPTION, searchQuery);
> search.setResourceType(CmsResourceTypeImage.getStaticTypeName());
>
> Then the result will only contain images that contain the searchQuery in
> the description.
>
> Regards
> Florian
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110512/5b1d1662/attachment.htm>


More information about the opencms-dev mailing list