[appengine-java] Re: Tag search

2010-03-08 Thread Max
I guess no.

There was 20 - 50 - 1000 unique tags
Tags were added using random algorythm.
Some tags were more popular then other. We used Normal distrubution.
The most popular tag was added to 10-50% of entities. (We had several
tests)
Every object had 10 tags.

Thanks


On Feb 17, 12:48 am, Ikai L (Google) ika...@google.com wrote:
 How many different kinds of tags are there? Is this an exploding indexes
 situation?

 http://code.google.com/appengine/docs/python/datastore/queriesandinde...





 On Tue, Feb 16, 2010 at 12:34 PM, Max max.seven@gmail.com wrote:
  I am sorry but it does not work. With 1 objects and searching for
  2 tags we got following error.

  com.google.appengine.api.datastore.DatastoreNeedIndexException: The
  built-in indices are not efficient enough for this query and your
  data. Please add a composite index for this query..  Unable to
  determine what index is missing.  This is probably a bug in the App
  Engine SDK.

  Solution I have proposed is not effecient enough when inserting data.
  It may take ~5 seconds per object.

  May be we have to host tag search server outside of google app engine.

  :(

  or decrease number of tags to minimum

  On Feb 12, 2:22 pm, Max max.seven@gmail.com wrote:
   Thank You very much it works!

   correct code is:-
                                   query.setFilter(tags == 'hello' 
   tags == 'world');

   I hope it will work with thousands and millions of records as well. I
   have not tested with large number of data yet.

   Thanks again!

   On Feb 12, 2:46 am, John Patterson jdpatter...@gmail.com wrote:

On 12 Feb 2010, at 06:53, Max wrote:

 I have not coded much in native API but I think it will search first
 for hello and then for world then mix results.

No, it does a merge join - only returning entities that match all
filters - not separate queries like the JDO contains() creates.

  --
  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
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B 
  unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

 --
 Ikai Lan
 Developer Programs Engineer, Google App 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-16 Thread Max
I am sorry but it does not work. With 1 objects and searching for
2 tags we got following error.

com.google.appengine.api.datastore.DatastoreNeedIndexException: The
built-in indices are not efficient enough for this query and your
data. Please add a composite index for this query..  Unable to
determine what index is missing.  This is probably a bug in the App
Engine SDK.

Solution I have proposed is not effecient enough when inserting data.
It may take ~5 seconds per object.

May be we have to host tag search server outside of google app engine.

:(

or decrease number of tags to minimum

On Feb 12, 2:22 pm, Max max.seven@gmail.com wrote:
 Thank You very much it works!

 correct code is:-
                                 query.setFilter(tags == 'hello' 
 tags == 'world');

 I hope it will work with thousands and millions of records as well. I
 have not tested with large number of data yet.

 Thanks again!

 On Feb 12, 2:46 am, John Patterson jdpatter...@gmail.com wrote:



  On 12 Feb 2010, at 06:53, Max wrote:

   I have not coded much in native API but I think it will search first
   for hello and then for world then mix results.

  No, it does a merge join - only returning entities that match all  
  filters - not separate queries like the JDO contains() creates.

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Tag search

2010-02-16 Thread Ikai L (Google)
How many different kinds of tags are there? Is this an exploding indexes
situation?

http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Big_Entities_and_Exploding_Indexes

On Tue, Feb 16, 2010 at 12:34 PM, Max max.seven@gmail.com wrote:

 I am sorry but it does not work. With 1 objects and searching for
 2 tags we got following error.

 com.google.appengine.api.datastore.DatastoreNeedIndexException: The
 built-in indices are not efficient enough for this query and your
 data. Please add a composite index for this query..  Unable to
 determine what index is missing.  This is probably a bug in the App
 Engine SDK.

 Solution I have proposed is not effecient enough when inserting data.
 It may take ~5 seconds per object.

 May be we have to host tag search server outside of google app engine.

 :(

 or decrease number of tags to minimum

 On Feb 12, 2:22 pm, Max max.seven@gmail.com wrote:
  Thank You very much it works!
 
  correct code is:-
  query.setFilter(tags == 'hello' 
  tags == 'world');
 
  I hope it will work with thousands and millions of records as well. I
  have not tested with large number of data yet.
 
  Thanks again!
 
  On Feb 12, 2:46 am, John Patterson jdpatter...@gmail.com wrote:
 
 
 
   On 12 Feb 2010, at 06:53, Max wrote:
 
I have not coded much in native API but I think it will search first
for hello and then for world then mix results.
 
   No, it does a merge join - only returning entities that match all
   filters - not separate queries like the JDO contains() creates.

 --
 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
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-12 Thread Max
Thank You very much it works!

correct code is:-
query.setFilter(tags == 'hello' 
tags == 'world');


I hope it will work with thousands and millions of records as well. I
have not tested with large number of data yet.

Thanks again!

On Feb 12, 2:46 am, John Patterson jdpatter...@gmail.com wrote:
 On 12 Feb 2010, at 06:53, Max wrote:

  I have not coded much in native API but I think it will search first
  for hello and then for world then mix results.

 No, it does a merge join - only returning entities that match all  
 filters - not separate queries like the JDO contains() creates.

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-11 Thread Max
Thanks, but if I add

SetString 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 jdpatter...@gmail.com 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 searchedread 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 google-appengine-java@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com
  .
  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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Tag search

2010-02-11 Thread John Patterson
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

SetString 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 jdpatter...@gmail.com 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 searchedread 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 google-appengine-java@googlegroups.com
.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com
.
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 google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-11 Thread Max

I can use
 
query.setFilter(tags.contains(tags1));  // not containsAll

with java.util.List object as tag. But it will return any object
containing at list one tag.

I wish to search for objects that has all tags that I specify. Is that
possible to do?









On Feb 12, 12:48 am, Max max.seven@gmail.com wrote:
 Thanks, but if I add

 SetString 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 jdpatter...@gmail.com 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 searchedread 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 
   google-appengine-java@googlegroups.com
   .
   To unsubscribe from this group, send email to 
   google-appengine-java+unsubscr...@googlegroups.com
   .
   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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-11 Thread Max
Thank You!

On Feb 12, 1:11 am, John Patterson jdpatter...@gmail.com 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

  SetString 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 jdpatter...@gmail.com 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 searchedread 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 
  google-appengine-java@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com
  .
  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 google-appengine-java@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com
  .
  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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-11 Thread Max
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 jdpatter...@gmail.com 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

  SetString 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 jdpatter...@gmail.com 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 searchedread 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 
  google-appengine-java@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com
  .
  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 google-appengine-java@googlegroups.com
  .
  To unsubscribe from this group, send email to 
  google-appengine-java+unsubscr...@googlegroups.com
  .
  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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Tag search

2010-02-11 Thread Max
Here is my tag search idea:-


If I have 4 tags

Then I can save following strings combinations

tag1,tag2,tag3,tag4,
tag1,tag2,tag4,
tag1,tag3,tag4,
tag1,tag4
tag2,tag3,tag4,
tag2,tag4,
tag3,tag4,
tag4,



class TagLine{
@PrimaryKey
@Persistent
Long id;

@Key
@Persistent
String tags;

@Persistent
Long objectId;
}



If I have search tag list  then I will implode tag list in a
string with comma as delimiter.
and search for tags (in TagLine) starting with that string

If I will have many tags that I will have to insert many TagLine
objects.

I estimate 2^(n-1) for n tags

So it is expensive feature and it is most efficient solution I have
found so far.



Sample search [tag3, tag2]
Sort: [tag2, tag3]
Implode into string tag2,tag3,


Object with this tags will have TagLine(s) starting with tag2,tag3,
In my sample data it is:- tag2,tag3,tag4,

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Tag search

2010-02-11 Thread John Patterson


On 12 Feb 2010, at 06:53, Max wrote:

I have not coded much in native API but I think it will search first
for hello and then for world then mix results.


No, it does a merge join - only returning entities that match all  
filters - not separate queries like the JDO contains() creates.


--
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.