Seven Steps to CRUD with Play Framework and Elastic Search with new release 0.0.4

341 views
Skip to first unread message

felipera

unread,
Mar 21, 2011, 10:26:55 PM3/21/11
to play-framework
Guys,

Released 0.0.4 for module ElasticSearch for bug fixes and improved
documentation. I also created a super simple step by step on how to
setup Play! with Elastic Search.

Play! guys, do you guys know why the documentation is not coming up on
the module page?

Step by Step
http://geeks.aretotally.in/seven-steps-to-crud-with-play-framework-and-elastic-search-with-new-release-0-0-4

Available on Github
https://github.com/mashup-fm/playframework-elasticsearch-basicdemo

0.0.4 Documentation
https://github.com/feliperazeek/playframework-elasticsearch

Thank you,
Felipe

sas

unread,
Mar 22, 2011, 2:44:54 AM3/22/11
to play-framework
Hey!

is that all?

just a @ElasticSearchable annotation?

great work...

On 21 mar, 23:26, felipera <felip...@gmail.com> wrote:
> Guys,
>
> Released 0.0.4 for module ElasticSearch for bug fixes and improved
> documentation. I also created a super simple step by step on how to
> setup Play! with Elastic Search.
>
> Play! guys, do you guys know why the documentation is not coming up on
> the module page?
>
> Step by Stephttp://geeks.aretotally.in/seven-steps-to-crud-with-play-framework-an...
>
> Available on Githubhttps://github.com/mashup-fm/playframework-elasticsearch-basicdemo
>
> 0.0.4 Documentationhttps://github.com/feliperazeek/playframework-elasticsearch
>
> Thank you,
> Felipe

Brainztorm

unread,
Mar 22, 2011, 5:16:53 AM3/22/11
to play-framework
Thanks for the update ! :)

About the roadmap, i vote for :

- Parent/Child support
- Customizations for mapping, etc
- Sample Search Page

;)

Thaks again Felipe :)

_yoko_

unread,
Mar 22, 2011, 7:00:56 AM3/22/11
to play-framework
A sample search page would really help newbees like me.

_yoko_

unread,
Mar 22, 2011, 6:58:28 AM3/22/11
to play-framework
You almost read my mind. I ran into some issues with 0.0.3 yesterday
and you already have a fix for it :)

Great Work.



On Mar 22, 7:26 am, felipera <felip...@gmail.com> wrote:
> Guys,
>
> Released 0.0.4 for module ElasticSearch for bug fixes and improved
> documentation. I also created a super simple step by step on how to
> setup Play! with Elastic Search.
>
> Play! guys, do you guys know why the documentation is not coming up on
> the module page?
>

felipera

unread,
Mar 23, 2011, 1:17:49 AM3/23/11
to play-framework
Hey guys,

Thank you all so much for the kind words, I really appreciate it. I am
having a great time, Play! has made me fall in love with Java (and
Scala) all over again.

Sorry about 0.0.3 I had it all working in my machine (heard that
before hehe) but I guess I forgot to include the latest version on the
distribution, I was pretty tired so I can totally see how I made a
mistake.

I also improved the documentation format for 0.0.4, it was just text
saved as textile before. Yesterday I was looking at the Grails doc
which generates a pretty cool output, might be a way too in the
future. I wrote a couple of plugins for Grails before but I was never
100% sold on it.

I agree a search page will help, I am debating between
implementations, such as creating a thin layer on top of ES's API and
provide an API. Ideally I would like to extend the CRUD module,
provide an API, and also create a reusable search code that would be
generic enough to be usable on any model.

I am a huge fan of location-based apps (geospatial queries, mobile)
since I worked for Real Estate Search apps for so long in the past
(Foreclosure.com, Fannie Mae, Freddie Mac, Zillow's Foreclosure
Channel, etc) so I would like to include geo features as well soon
hopefully. I got so much code I wrote in the past, just need to sort
it through, cleanup, etc.

Anyway I got a project I am really excited about that I am working
with someone else, I will announce soon.

On a side note I was having a meeting trying to sell a project for a
pretty famous startup here in NYC, nobody seems to know Play! here
which I am pretty surprised about. Maybe I should start a Meetup, any
NYC Play! lovers out there? Back in FL we were really into it, those
guys from Foreclosure.com are kicking ass with it.

I guess it's time to try to go to sleep...somehow I think I am gonna
end up writing some more code, I missed it badly.

Thank you!
Felipe

ps: sorry I just saw these messages sometimes I get lost with so many
emails, I normally see it quicker on my blog http://geeks.aretotally.in/.

felipera

unread,
Mar 23, 2011, 1:18:53 AM3/23/11
to play-framework
:)

Basically it requires no configuration, nothing by default, just the
annotation.

I def appreciate all the feedback, you can always find me at
http://geeks.aretotally.in/.

grandfatha

unread,
Mar 23, 2011, 4:01:19 AM3/23/11
to play-framework
I did the seven steps and it didnt quite work.

1) Got an error "SampleModel.java is already defined" -> Does your
plugin have sample code on its classpath?
-> Renamed file and class to "SampleModel2.java"

2) Had to rename the controller class to be a a plural of the entity
name ("SampleModel2s.java") for it to be autodetected in the admin
interface.

3) Added the following to the routes file

GET /es
ElasticSearchAdmin.index

Otherwise I would get a 404 for the es-admin url


GET /lib/ staticDir:public

Because in your plugin "elasticsearch/index.html" you reference the js
with a "lib" folder, so I added a route for that to go to the "public"
directory as a static directory (in which these files actually live?).
Otherwise the 404 would have been solved for the html, but the js
files wouldnt be available.


After doing that I could add entities using the crud module and search
for them using your administrative interface.





To my surprise though, ElasticSearch didnt index the string fields
using n-grams. If I added a text to field1 like "narf", searching for
"nrf" did not yield any result. Most users are spoiled by being able
to enter a completely vague search phrase and still find what they
want on internet search engines like Google. Is there a way to
configure the embedded elasticsearch instance to analyze the text more
deeply?

felipera

unread,
Mar 24, 2011, 3:11:59 AM3/24/11
to play-framework
1) Good point I renamed it, fixed.

2) Fixed.

3) You are missing a "/" at the end http://localhost:9000/es-admin/


Hi Everyone,

I made very good progress today with ES and Play! integration. A lot
of people have asked me for more sample code and app. I am releasing
0.0.5 with a super easy search api. I am just cleaning up the code,
testing - I should have a sample app this weekend.

It will look like this at this point:

FieldQueryBuilder builder = new FieldQueryBuilder ("fieldName",
value);
SearchResults results = ElasticSearch.search(builder);


SearchResults is a very simple POJO with two properties for now,
totalCount and list of objects.

Currently there's no way to change indexing behavior but I know it's
important, I will work on it, time to get some sleep, I haven't slept
in 3 nights and I need to be at work in 4 hours :)

I was basically testing by changing CRUD's search implementation,
looks like it will work.

Have a great one and thank you,
Felipe

Steve Chaloner

unread,
Mar 24, 2011, 3:53:15 AM3/24/11
to play-framework
The documentation link for v0.0.4 gives a 404 -
http://www.playframework.org/modules/elasticsearch-0.0.4/home

On Mar 24, 8:11 am, felipera <felip...@gmail.com> wrote:
> 1) Good point I renamed it, fixed.
>
> 2) Fixed.
>
> 3) You are missing a "/" at the endhttp://localhost:9000/es-admin/

Albin

unread,
Jan 21, 2013, 9:06:03 AM1/21/13
to play-fr...@googlegroups.com
http://geeks.aretotally.in/seven-steps-to-crud-with-play-framework-and-elastic-search-with-new-release-0-0-4 my brower is advising me to not visit the page... Is there another site where I can find the documentation. The module is awsome but without documentation Im just guessing what Im doing
Reply all
Reply to author
Forward
0 new messages