I wrote this comment on the objectify mailing list earlier today; it
seems apropos so I will copy it here:

-----

Sadly, true fulltext search is not something offered by appengine.
It's not impossible to layer on top of appengine, but it's a
nontrivial problem.

The dumb solution (that will work for small data sets) is to simply
iterate through *all* the data and do String.indexOf on the relevant
fields.  This is basically what LIKE '%basic%' does in most databases.

The smart solution is to build a fulltext index using something like
Lucene.  Basically, Lucene goes through your strings, chops them into
words, "stems" the words (cuts off the 's' at the end of plurals,
etc), and builds an index from that word to all the places the word is
used.  This isn't quite the same as doing a LIKE '%basic%' because the
fulltext index will only catch the word 'basic', it won't catch words
like 'msbasic'.  The stemmer will probably catch words like
'basically' though.

Search around, maybe someone has built a fulltext indexer that runs on GAE.

Jeff

On Thu, Apr 1, 2010 at 6:29 PM, John Patterson <jdpatter...@gmail.com> wrote:
> Like Gal said, you would need to make your own full-text search.  You don't
> need an OR query if all values are in a single multi-valued property.  You
> could do this by creating an index entity:
> CandidatesSearch
> {
> @Parent Candidate source;
> List<String> words;
> }
> It is a child of the Candidate so you can store and update both in a
> transaction
> Add every word in name, skills etc then just do
> datastore.store(candidateSearch);
> datastore.find()
> .type(CandidatesSearch.class)
> .filter("words", EQUAL, searchcontents)
> .fetchNoFields()
> .returnParentsNow();
> This is ObjectDatastore query syntax from Twig but the same concept would
> work in JDO, Objectify, SimpleDS etc
> John
> On 1 Apr 2010, at 22:27, Gal Dolber wrote:
>
> There is no easy way to do that.
> Problems:
>
> Appengine do not support fulltext queries
> Appengine do not support OR
>
> Solutions:
>
> Make your own fulltext search implementation
> Use IN operand
>
> 2010/4/1 Manjoor <manjoora...@gmail.com>
>>
>> I have a simple java class with following attributes
>>
>> Candidates.java
>> name
>> skills
>> education
>> currentEmployer
>>
>>
>> I need app-engine java equevalent code of the following SQL query
>>
>> Select * from Candidates
>>  where (name like '%searchcontent%') OR
>> (skills like '%searchcontent%') OR
>> (education like '%searchcontent%') OR
>> (currentEmployer like '%searchcontent%')
>>
>>
>>
>> --
>> 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.
>
> --
> 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