Can you please send the link to the video you refer to ?

From:  Ben Woodhead <benwoodhead1...@gmail.com>
Reply-To:  <google-appengine-java@googlegroups.com>
Date:  Sat, 30 Oct 2010 22:56:12 -0700 (PDT)
To:  <google-appengine-java@googlegroups.com>
Subject:  [appengine-java] Hierarchical Search

Hello Everybody, 

I am trying to build an efficient search like I saw in one of the google IO
videos. So the goal is to use the hierarchy of the datastore to make the
search more effecient. The datastore would look something like this:

Database words
Database words.articlesmap
Database articles

Each article is broken down into a set of words and the article map just
holds the key to the article. The basic path

Find the article i want and get its key.
Use the key to search for all words.articlemap
Get the parent of each articleamp.

At this point I am completely lost. Heres what I have so far but I have no
idea if I am on the right path and second how do I actually do the search

Word.java
[code]
@PersistenceCapable
public class Word {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key mKey;
    
    @Persistent
    String mWord;
    
    @Persistent
    List<ArticleMap> mArticleList;
    
    public Word(String word)
    {
    mWord = word;
    }
    
    public Key GetKey() {
    return mKey;
    }

    public void SetKey(Key key) {
    mKey = key;
    }
    
    public String GetWord()
    { 
    return mWord;
    }

    public void AddArticleMap( ArticleMap article )
    {
    if ( !mArticleList.contains(article) ) {
    mArticleList.add(article);
    }
    }

    public void RemoveArticleMap( ArticleMap article )
    {
    if ( !mArticleList.contains(article) ) {
    mArticleList.remove(article);
    }
    }
}

[/code]

ArticleMap.java
[code]
@PersistenceCapable
public class ArticleMap {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key mKey;

@Persistent
private Key mArticleKey;
 
public Key GetKey() {
return mKey;
}

public void SetKey(Key key) {
mKey = key;
}
public Key GetArticleKey() {
return mArticleKey;
}

public void SetArticleKey(Key key) {
mArticleKey = key;
}
}
[/code]

Article.java
[code]
@PersistenceCapable
public class Article {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key mKey;
   
    @Persistent
    private Text mText;
    
    public Article( Text text ) {
    SetText(text);
    }
    
    public Key GetKey() {
    return mKey;
    }

    public void SetKey(Key key) {
    mKey = key;
    }

public void SetText(Text text) {
mText = text;
}

public Text GetText() {
return mText;
}
}
[/code]

How do I tie the article map to the word itself, how do I tie the article to
the article map. How do I search for based on article map and map that to
article. 

Thank you for your time
Ben




-- 
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.


-- 
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.

Reply via email to