From: Mohamed <moh...@gm...> - 2009-01-05 18:30:41
|
Hi, I am new to this list. I have been using Hibernate through Grails and Gorm for a while now and I just switched my DB to Postgres from MySql to take advantage of the fulltext support in PostgresSql. I was wondering if it is possible and if so, how to write HQL queries that involves the TSearch2. An Sql query would look something like this : select title from someTable where to_tsvector('english', description) @@ to_tsquery('english', 'car') and where name = 'carl'; Where the fulltext search is this part : to_tsvector('english', description) @@ to_tsquery('english', 'car') How does this look like in HQL ? Is this possible to use a DB special features with Hibernate ? / Moe |
From: Emmanuel B. <emm...@hi...> - 2009-01-05 20:33:10
|
It is not possible. But I encourage you to look at Hibernate Search for your full text needs. It does not rely on your database capabilities and works as expected in Grails. Also, please ask your questions at http://forum.hibernate.org Emmanuel On Jan 5, 2009, at 13:30, Mohamed wrote: > Hi, I am new to this list. I have been using Hibernate through > Grails and Gorm for a while now and I just switched my DB to > Postgres from MySql to take advantage of the fulltext support in > PostgresSql. > > I was wondering if it is possible and if so, how to write HQL > queries that involves the TSearch2. > > An Sql query would look something like this : > > select title from someTable where > > to_tsvector('english', description) @@ to_tsquery('english', 'car') > and where name = 'carl'; > > > Where the fulltext search is this part : to_tsvector('english', > description) @@ to_tsquery('english', 'car') > > > How does this look like in HQL ? Is this possible to use a DB > special features with Hibernate ? > > / Moe > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel |
From: Mohamed <moh...@gm...> - 2009-01-05 21:14:52
|
Thank you Emmanuel. Can you tell me more about it ? I have spent so much time back and forth deciding on how and what should handle my search. I must say, I remember that his was a possibility now early in my development but none in the grails community have mentioned it as an option when I have brought up the search discussion... How powerful is it? Compared to lucene ? (ooh now I see that its built on lucene)... but how come no one have mentioned it in grails... does this come with the normal grails/hibernate distro ? Or is it like a plugin ? May main reason for going for postgres Tsearch is the possibilty to mix fulltext and relational matching... I guess this is not a problem with Hibernate search ? Is there any drawbacks I should know about ? Thank you / Moe On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: > It is not possible. But I encourage you to look at Hibernate Search for > your full text needs. It does not rely on your database capabilities and > works as expected in Grails. > Also, please ask your questions at http://forum.hibernate.org > > Emmanuel > > On Jan 5, 2009, at 13:30, Mohamed wrote: > > Hi, I am new to this list. I have been using Hibernate through Grails and > Gorm for a while now and I just switched my DB to Postgres from MySql to > take advantage of the fulltext support in PostgresSql. > I was wondering if it is possible and if so, how to write HQL queries that > involves the TSearch2. > > An Sql query would look something like this : > > select title from someTable where > > to_tsvector('english', description) @@ to_tsquery('english', 'car') and > where name = 'carl'; > > > Where the fulltext search is this part : to_tsvector('english', > description) @@ to_tsquery('english', 'car') > > > How does this look like in HQL ? Is this possible to use a DB special > features with Hibernate ? > > / Moe > > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > |
From: Mohamed <moh...@gm...> - 2009-01-05 21:52:34
|
Ok, i have now :). Another question I have on my mind. If one performs an SQL query. Will I be able to return the domain object as HQL or GORM would have? select domain from domain where ... Will I be able to use the returned value just like HQL would have returned it, as a domain object? On Mon, Jan 5, 2009 at 10:17 PM, Emmanuel Bernard <emm...@hi...>wrote: > Please ask your questions at http://forum.hibernate.org. There is a > dedicated forum for Hibernate Search :) > > On Jan 5, 2009, at 16:14, Mohamed wrote: > > Thank you Emmanuel. Can you tell me more about it ? I have spent so much > time back and forth deciding on how and what should handle my search. I must > say, I remember that his was a possibility now early in my development but > none in the grails community have mentioned it as an option when I have > brought up the search discussion... > How powerful is it? Compared to lucene ? (ooh now I see that its built on > lucene)... but how come no one have mentioned it in grails... does this come > with the normal grails/hibernate distro ? Or is it like a plugin ? > > May main reason for going for postgres Tsearch is the possibilty to mix > fulltext and relational matching... I guess this is not a problem with > Hibernate search ? Is there any drawbacks I should know about ? > > Thank you / Moe > > On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: > >> It is not possible. But I encourage you to look at Hibernate Search for >> your full text needs. It does not rely on your database capabilities and >> works as expected in Grails. >> Also, please ask your questions at http://forum.hibernate.org >> >> Emmanuel >> >> On Jan 5, 2009, at 13:30, Mohamed wrote: >> >> Hi, I am new to this list. I have been using Hibernate through Grails and >> Gorm for a while now and I just switched my DB to Postgres from MySql to >> take advantage of the fulltext support in PostgresSql. >> I was wondering if it is possible and if so, how to write HQL queries that >> involves the TSearch2. >> >> An Sql query would look something like this : >> >> select title from someTable where >> >> to_tsvector('english', description) @@ to_tsquery('english', 'car') and >> where name = 'carl'; >> >> >> Where the fulltext search is this part : to_tsvector('english', >> description) @@ to_tsquery('english', 'car') >> >> >> How does this look like in HQL ? Is this possible to use a DB special >> features with Hibernate ? >> >> / Moe >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> hibernate-devel mailing list >> hib...@li... >> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> >> >> > > ------------------------------------------------------------------------------ > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel > > > > |
From: Mohamed <moh...@gm...> - 2009-01-06 09:07:26
|
I just want to say thank you for reminding me again about this option Emmanuel. The last two weeks I have been just trying out different approaches: Compass, Searchable and built in fulltext support DB's. But the fact is that all of them are either too complex or take me away from my hibernate domain model. If I want search, I have to use their API and usually only fulltext search is possible or the queries gets way to complex. I just finished reading : http://www.jroller.com/kimchy/entry/hibernate_search_lucene and I must say that what Shay fails to realize is that it's a little bit too complex using compass, it should be easier (why searchable even go to the surface), new developers don't want to learn yet another thing to use, I have learned so much already I think I will crack soon! :) lol I will give it a try but now I think I have landed now :) About your book, does it cover grails search? I am not familiar with the classic Hibernate XML set ups. Do you have any link to any grails + hibernate search set up. I can't seem to find any... / Moe On Mon, Jan 5, 2009 at 10:45 PM, Mohamed <moh...@gm...>wrote: > Ok, i have now :). Another question I have on my mind. If one performs an > SQL query. Will I be able to return the domain object as HQL or GORM would > have? select domain from domain where ... Will I be able to use the returned > value just like HQL would have returned it, as a domain object? > > > On Mon, Jan 5, 2009 at 10:17 PM, Emmanuel Bernard <emm...@hi...>wrote: > >> Please ask your questions at http://forum.hibernate.org. There is a >> dedicated forum for Hibernate Search :) >> >> On Jan 5, 2009, at 16:14, Mohamed wrote: >> >> Thank you Emmanuel. Can you tell me more about it ? I have spent so much >> time back and forth deciding on how and what should handle my search. I must >> say, I remember that his was a possibility now early in my development but >> none in the grails community have mentioned it as an option when I have >> brought up the search discussion... >> How powerful is it? Compared to lucene ? (ooh now I see that its built on >> lucene)... but how come no one have mentioned it in grails... does this come >> with the normal grails/hibernate distro ? Or is it like a plugin ? >> >> May main reason for going for postgres Tsearch is the possibilty to mix >> fulltext and relational matching... I guess this is not a problem with >> Hibernate search ? Is there any drawbacks I should know about ? >> >> Thank you / Moe >> >> On Mon, Jan 5, 2009 at 9:06 PM, Emmanuel Bernard <emm...@hi...>wrote: >> >>> It is not possible. But I encourage you to look at Hibernate Search for >>> your full text needs. It does not rely on your database capabilities and >>> works as expected in Grails. >>> Also, please ask your questions at http://forum.hibernate.org >>> >>> Emmanuel >>> >>> On Jan 5, 2009, at 13:30, Mohamed wrote: >>> >>> Hi, I am new to this list. I have been using Hibernate through Grails and >>> Gorm for a while now and I just switched my DB to Postgres from MySql to >>> take advantage of the fulltext support in PostgresSql. >>> I was wondering if it is possible and if so, how to write HQL queries >>> that involves the TSearch2. >>> >>> An Sql query would look something like this : >>> >>> select title from someTable where >>> >>> to_tsvector('english', description) @@ to_tsquery('english', 'car') and >>> where name = 'carl'; >>> >>> >>> Where the fulltext search is this part : to_tsvector('english', >>> description) @@ to_tsquery('english', 'car') >>> >>> >>> How does this look like in HQL ? Is this possible to use a DB special >>> features with Hibernate ? >>> >>> / Moe >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> hibernate-devel mailing list >>> hib...@li... >>> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >>> >>> >>> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> hibernate-devel mailing list >> hib...@li... >> https://lists.sourceforge.net/lists/listinfo/hibernate-devel >> >> >> >> > |