query.setFilter("tags == 'hello'");
query.setFilter("tags == 'world'");
-------------------
I have not coded much in native API but I think it will search first
for hello and then for world then mix results.
How "tags" property defined in your Model?
Is "tags" a property of "Object" entity of "tags" is property of "Tag"
entity linked with "Object" entity?
May be I have to try to code it in native API. Could you show some
sample code?
I have idea how to implement tags. It is "expensive" idea but it
should work with up to 6-8 tags per object.
I will post it in next post.
On Feb 12, 1:11 am, John Patterson <[email protected]> wrote:
> Yes you can query for multiple tags. Not too sure about the JDO
> syntax but try something like:
>
> query.setFilter("tags == 'hello'");
> query.setFilter("tags == 'world'");
>
> On 12 Feb 2010, at 05:48, Max wrote:
>
>
>
> > Thanks, but if I add
>
> > Set<String> tags
>
> > and I search
>
> > query.setFilter("tags.containsAll(tags1)");
> > query.declareParameters("java.util.List tags1");
>
> > Then it tells
>
> > Unsupported method <containsAll> while parsing expression:
> > InvokeExpression
> > {[PrimaryExpression{tags}].containsAll(ParameterExpression{tags1})}
>
> > Is that possible to search for multiple tags or not?
>
> > ---
>
> > I have some ideas how to search for 2 tags or 3 tags. But it will
> > requires all 2 tag pair combinations to be stored for each object. 3
> > tags search will require even more combinations of 3 tags for each
> > object.
>
> > Have someone implemented tag search already?
>
> > Thanks,
> > Max
>
> > On Feb 9, 9:34 pm, John Patterson <[email protected]> wrote:
> >> Hi Max, you could store tags as a multi-valued property which will
> >> allow you to search for entities with all tags in a single query. To
> >> track how common a tag is you should maintain a count entity for each
> >> one.
>
> >> On 10 Feb 2010, at 02:23, Max wrote:
>
> >>> I already searched&read app-engine(|-java|-python) forums for "tag
> >>> search" and it looks like the the best way to implement tags is
> >>> unordered relationship many to many.
>
> >>> I can search for object with one tag. But I would like to specify
> >>> multiple tags.
>
> >>> e.g. I wish objects that has all 10 tags that I specify or any of 10
> >>> tags that I specify.
>
> >>> I would like to generate tag cloud also.
> >>> But "SELECT name, count(name) from Tags GROUP by name" is not
> >>> supported
>
> >>> Is that possible to implement all most common tag features with app
> >>> engine?
>
> >>> I start thinking that it is not possible.
>
> >>> I will have millions of object. So I can't select all objects.
>
> >>> Have someone implemented tags in App Engine?
>
> >>> Please, tell if know that it is not possible to implement tags in
> >>> App
> >>> Engine.
>
> >>> Thanks, Max
>
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Google App Engine for Java" group.
> >>> To post to this group, send email to
> >>> [email protected]
> >>> .
> >>> To unsubscribe from this group, send email to
> >>> [email protected]
> >>> .
> >>> For more options, visit this group
> >>> athttp://groups.google.com/group/google-appengine-java?hl=en
> >>> .
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Google App Engine for Java" group.
> > To post to this group, send email to [email protected]
> > .
> > To unsubscribe from this group, send email to
> > [email protected]
> > .
> > For more options, visit this group
> > athttp://groups.google.com/group/google-appengine-java?hl=en
> > .
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.