You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@esme.apache.org by Xuefeng Wu <be...@gmail.com> on 2009/11/15 16:10:58 UTC
lucene search(Compass) at ESME
Hi,
I'm sorry I'm busy these days and didn't do anything about ESME except keep
an eye on.
Today I have free time and try to resolve
ESME-101<https://issues.apache.org/jira/browse/ESME-101>.
I learned compass some hours and try to find out why the Search is broken.
But fail to resolve the defects.
I have a question:
I think Compass should know how to access the data but I didn't find any
configure for this.
Compass provide solution that could integrate with hibernate,JPA,JDBC ect.
Did we need CompassGps?
I'm not family with JPA with Lift, I use JDBC Gps, but failed too, I think
maybe I miss something....
I added such as:
val conf = tryo(new CompassConfiguration()
.configure(Props.get("compass_config_file") openOr
"/props/compass.cfg.xml")
.addClass((new Message).clazz))
def dataSource(): DataSource= {
println("Create datasrouce")
val bds: BasicDataSource = new BasicDataSource();
bds.setDriverClassName("com.mysql.jdbc.Driver");
bds.setUrl("jdbc:mysql://localhost/esme");
bds.setUsername("esme");
bds.setPassword("esme");
bds
}
val mapping = {
val _mapping: ResultSetToResourceMapping = new
ResultSetToResourceMapping();
_mapping.setAlias("message");
_mapping.setSelectQuery("select m.id as id, m.text as text, m.source as
source from esme.message m");
// maps from a parent_id column to a resource property named parent-id
_mapping.addIdMapping(new IdColumnToPropertyMapping("id", "id"));
_mapping.addDataMapping(new DataColumnToPropertyMapping("text",
"text"));
_mapping.addDataMapping(new DataColumnToPropertyMapping("source",
"source"));
_mapping
}
private val ismr: InputStreamMappingResolver = {
val ri: ResultSetResourceMappingResolver = new
ResultSetResourceMappingResolver()
ri.setDataSource(dataSource)
ri.setMapping(mapping)
println(ri)
ri
}
val compass = conf.map(cf => {
try{cf.addMappingResover(ismr)}catch{case _ =>
println} ......
--
Scala中文社区: http://groups.google.com/group/scalacn
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
Actually in the latest checked-in version, search is visible on the
main messages page. This version isn't deployed on stax, because I
didn't want to deploy on non-working of ESME (based on lift bug).
D.
On Mon, Nov 16, 2009 at 7:08 AM, Xuefeng Wu <be...@gmail.com> wrote:
> @Vassil
> I debug at the server side and found the compass return empty.
>
>
> On Mon, Nov 16, 2009 at 1:24 PM, Vassil Dichev <vd...@apache.org> wrote:
>
>> I think the problem could be that the search menu is defined as
>> hidden, so it always renders an empty page. In Boot.scala:
>>
>> Menu(Loc("search", List("user_view", "search"),
>> S.?("base_menu_search"), Hidden)) ::
>>
>
>
>
> --
> Scala中文社区: http://groups.google.com/group/scalacn
>
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
What is interesting is that compass is indexing the messages but the
results are still empty.
D.
On Tue, Nov 17, 2009 at 8:47 AM, Vassil Dichev <vd...@apache.org> wrote:
>> It got lost somewhere. I've just added it back to the code repository.
>>
>> Thanks for finding it. I've been using a different compass cfg file.
>
> I wish this solved the problem, but it doesn't. Now a compass session
> can be opened successfully, but the search results always return 0
> hits, no matter what I type. I've recreated the compass index,
> restarted, entered new messages, but still nothing. I also compared to
> code from the old repo, where it used to work, but can't really find
> what's different:
>
> http://code.google.com/p/esmeproject/source/browse/#svn/trunk/esme-lift
>
Re: lucene search(Compass) at ESME
Posted by Vassil Dichev <vd...@apache.org>.
> It got lost somewhere. I've just added it back to the code repository.
>
> Thanks for finding it. I've been using a different compass cfg file.
I wish this solved the problem, but it doesn't. Now a compass session
can be opened successfully, but the search results always return 0
hits, no matter what I type. I've recreated the compass index,
restarted, entered new messages, but still nothing. I also compared to
code from the old repo, where it used to work, but can't really find
what's different:
http://code.google.com/p/esmeproject/source/browse/#svn/trunk/esme-lift
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
It got lost somewhere. I've just added it back to the code repository.
Thanks for finding it. I've been using a different compass cfg file.
D.
On Tue, Nov 17, 2009 at 12:21 AM, Vassil Dichev <vd...@apache.org> wrote:
> In Boot, I get this for Compass.compass:
>
> org.compass.core.config.ConfigurationException: Failed to open config
> resource [/props/compass.cfg.xml]
>
> and indeed, there is no compass.cfg.xml
>
>
> On Mon, Nov 16, 2009 at 9:29 AM, Richard Hirsch <hi...@gmail.com> wrote:
>> @Xuefeng I had the same problem.
>>
>> D.
>>
>> On Mon, Nov 16, 2009 at 7:08 AM, Xuefeng Wu <be...@gmail.com> wrote:
>>> @Vassil
>>> I debug at the server side and found the compass return empty.
>>>
>>>
>>> On Mon, Nov 16, 2009 at 1:24 PM, Vassil Dichev <vd...@apache.org> wrote:
>>>
>>>> I think the problem could be that the search menu is defined as
>>>> hidden, so it always renders an empty page. In Boot.scala:
>>>>
>>>> Menu(Loc("search", List("user_view", "search"),
>>>> S.?("base_menu_search"), Hidden)) ::
>>>>
>>>
>>>
>>>
>>> --
>>> Scala中文社区: http://groups.google.com/group/scalacn
>>>
>>
>
Re: lucene search(Compass) at ESME
Posted by Vassil Dichev <vd...@apache.org>.
In Boot, I get this for Compass.compass:
org.compass.core.config.ConfigurationException: Failed to open config
resource [/props/compass.cfg.xml]
and indeed, there is no compass.cfg.xml
On Mon, Nov 16, 2009 at 9:29 AM, Richard Hirsch <hi...@gmail.com> wrote:
> @Xuefeng I had the same problem.
>
> D.
>
> On Mon, Nov 16, 2009 at 7:08 AM, Xuefeng Wu <be...@gmail.com> wrote:
>> @Vassil
>> I debug at the server side and found the compass return empty.
>>
>>
>> On Mon, Nov 16, 2009 at 1:24 PM, Vassil Dichev <vd...@apache.org> wrote:
>>
>>> I think the problem could be that the search menu is defined as
>>> hidden, so it always renders an empty page. In Boot.scala:
>>>
>>> Menu(Loc("search", List("user_view", "search"),
>>> S.?("base_menu_search"), Hidden)) ::
>>>
>>
>>
>>
>> --
>> Scala中文社区: http://groups.google.com/group/scalacn
>>
>
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
@Xuefeng I had the same problem.
D.
On Mon, Nov 16, 2009 at 7:08 AM, Xuefeng Wu <be...@gmail.com> wrote:
> @Vassil
> I debug at the server side and found the compass return empty.
>
>
> On Mon, Nov 16, 2009 at 1:24 PM, Vassil Dichev <vd...@apache.org> wrote:
>
>> I think the problem could be that the search menu is defined as
>> hidden, so it always renders an empty page. In Boot.scala:
>>
>> Menu(Loc("search", List("user_view", "search"),
>> S.?("base_menu_search"), Hidden)) ::
>>
>
>
>
> --
> Scala中文社区: http://groups.google.com/group/scalacn
>
Re: lucene search(Compass) at ESME
Posted by Xuefeng Wu <be...@gmail.com>.
@Vassil
I debug at the server side and found the compass return empty.
On Mon, Nov 16, 2009 at 1:24 PM, Vassil Dichev <vd...@apache.org> wrote:
> I think the problem could be that the search menu is defined as
> hidden, so it always renders an empty page. In Boot.scala:
>
> Menu(Loc("search", List("user_view", "search"),
> S.?("base_menu_search"), Hidden)) ::
>
--
Scala中文社区: http://groups.google.com/group/scalacn
Re: lucene search(Compass) at ESME
Posted by Vassil Dichev <vd...@apache.org>.
I think the problem could be that the search menu is defined as
hidden, so it always renders an empty page. In Boot.scala:
Menu(Loc("search", List("user_view", "search"),
S.?("base_menu_search"), Hidden)) ::
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
Excellent plan. Getting familar with lucenene for the work project
before tackling the ESME problem will make looking for the error much
easier.
D.
On Mon, Nov 16, 2009 at 6:01 AM, Xuefeng Wu <be...@gmail.com> wrote:
> @D.
>
> Maybe I will use compass in our company for next project. At that time I
> will have much time to learn compass.
>
> I would resolve some small defects before I'm family with compass.
>
> And thank you for that mentioned me.
>
>
> On Sun, Nov 15, 2009 at 11:46 PM, Richard Hirsch <hi...@gmail.com>wrote:
>
>> The Compass integration should work and I've tried to get it to work
>> in the Stax environment. Everything should be configured correctly
>> (for file-based storage).
>>
>> I've tried it in the stax environment and wasn't successful. I can see
>> that compass searches correctly but never finds anything (:-<) It is
>> definitely a tough jira item.
>>
>> If you want take a look at Jira again and pick another jira item, you
>> could do this as well. There are a lot of smaller tasks that I
>> recently created. Many of them are related to other work you have
>> done (creating new attributes, etc.). If you could do finish a few of
>> these items this would be a big help.
>>
>> By the way, I don't know whether you saw the blog that described our
>> internationalization efforts (
>> http://blog.esme.us/internationalization-efforts-begin-esme-in-chinese/)
>> - I mentioned you by name.
>>
>> D.
>>
>>
>>
>> On Sun, Nov 15, 2009 at 4:10 PM, Xuefeng Wu <be...@gmail.com> wrote:
>> > Hi,
>> >
>> > I'm sorry I'm busy these days and didn't do anything about ESME except
>> keep
>> > an eye on.
>> >
>> > Today I have free time and try to resolve
>> > ESME-101<https://issues.apache.org/jira/browse/ESME-101>.
>> >
>> > I learned compass some hours and try to find out why the Search is
>> broken.
>> > But fail to resolve the defects.
>> >
>> > I have a question:
>> > I think Compass should know how to access the data but I didn't find any
>> > configure for this.
>> > Compass provide solution that could integrate with hibernate,JPA,JDBC
>> ect.
>> > Did we need CompassGps?
>> >
>> >
>> > I'm not family with JPA with Lift, I use JDBC Gps, but failed too, I
>> think
>> > maybe I miss something....
>> >
>> > I added such as:
>> > val conf = tryo(new CompassConfiguration()
>> > .configure(Props.get("compass_config_file") openOr
>> > "/props/compass.cfg.xml")
>> > .addClass((new Message).clazz))
>> >
>> > def dataSource(): DataSource= {
>> > println("Create datasrouce")
>> > val bds: BasicDataSource = new BasicDataSource();
>> > bds.setDriverClassName("com.mysql.jdbc.Driver");
>> > bds.setUrl("jdbc:mysql://localhost/esme");
>> > bds.setUsername("esme");
>> > bds.setPassword("esme");
>> > bds
>> > }
>> >
>> > val mapping = {
>> > val _mapping: ResultSetToResourceMapping = new
>> > ResultSetToResourceMapping();
>> > _mapping.setAlias("message");
>> > _mapping.setSelectQuery("select m.id as id, m.text as text, m.source
>> as
>> > source from esme.message m");
>> > // maps from a parent_id column to a resource property named parent-id
>> > _mapping.addIdMapping(new IdColumnToPropertyMapping("id", "id"));
>> > _mapping.addDataMapping(new DataColumnToPropertyMapping("text",
>> > "text"));
>> > _mapping.addDataMapping(new DataColumnToPropertyMapping("source",
>> > "source"));
>> > _mapping
>> > }
>> >
>> > private val ismr: InputStreamMappingResolver = {
>> >
>> > val ri: ResultSetResourceMappingResolver = new
>> > ResultSetResourceMappingResolver()
>> > ri.setDataSource(dataSource)
>> > ri.setMapping(mapping)
>> > println(ri)
>> > ri
>> > }
>> >
>> > val compass = conf.map(cf => {
>> > try{cf.addMappingResover(ismr)}catch{case _ =>
>> > println} ......
>> >
>> > --
>> > Scala中文社区: http://groups.google.com/group/scalacn
>> >
>>
>
>
>
> --
> Scala中文社区: http://groups.google.com/group/scalacn
>
Re: lucene search(Compass) at ESME
Posted by Xuefeng Wu <be...@gmail.com>.
@D.
Maybe I will use compass in our company for next project. At that time I
will have much time to learn compass.
I would resolve some small defects before I'm family with compass.
And thank you for that mentioned me.
On Sun, Nov 15, 2009 at 11:46 PM, Richard Hirsch <hi...@gmail.com>wrote:
> The Compass integration should work and I've tried to get it to work
> in the Stax environment. Everything should be configured correctly
> (for file-based storage).
>
> I've tried it in the stax environment and wasn't successful. I can see
> that compass searches correctly but never finds anything (:-<) It is
> definitely a tough jira item.
>
> If you want take a look at Jira again and pick another jira item, you
> could do this as well. There are a lot of smaller tasks that I
> recently created. Many of them are related to other work you have
> done (creating new attributes, etc.). If you could do finish a few of
> these items this would be a big help.
>
> By the way, I don't know whether you saw the blog that described our
> internationalization efforts (
> http://blog.esme.us/internationalization-efforts-begin-esme-in-chinese/)
> - I mentioned you by name.
>
> D.
>
>
>
> On Sun, Nov 15, 2009 at 4:10 PM, Xuefeng Wu <be...@gmail.com> wrote:
> > Hi,
> >
> > I'm sorry I'm busy these days and didn't do anything about ESME except
> keep
> > an eye on.
> >
> > Today I have free time and try to resolve
> > ESME-101<https://issues.apache.org/jira/browse/ESME-101>.
> >
> > I learned compass some hours and try to find out why the Search is
> broken.
> > But fail to resolve the defects.
> >
> > I have a question:
> > I think Compass should know how to access the data but I didn't find any
> > configure for this.
> > Compass provide solution that could integrate with hibernate,JPA,JDBC
> ect.
> > Did we need CompassGps?
> >
> >
> > I'm not family with JPA with Lift, I use JDBC Gps, but failed too, I
> think
> > maybe I miss something....
> >
> > I added such as:
> > val conf = tryo(new CompassConfiguration()
> > .configure(Props.get("compass_config_file") openOr
> > "/props/compass.cfg.xml")
> > .addClass((new Message).clazz))
> >
> > def dataSource(): DataSource= {
> > println("Create datasrouce")
> > val bds: BasicDataSource = new BasicDataSource();
> > bds.setDriverClassName("com.mysql.jdbc.Driver");
> > bds.setUrl("jdbc:mysql://localhost/esme");
> > bds.setUsername("esme");
> > bds.setPassword("esme");
> > bds
> > }
> >
> > val mapping = {
> > val _mapping: ResultSetToResourceMapping = new
> > ResultSetToResourceMapping();
> > _mapping.setAlias("message");
> > _mapping.setSelectQuery("select m.id as id, m.text as text, m.source
> as
> > source from esme.message m");
> > // maps from a parent_id column to a resource property named parent-id
> > _mapping.addIdMapping(new IdColumnToPropertyMapping("id", "id"));
> > _mapping.addDataMapping(new DataColumnToPropertyMapping("text",
> > "text"));
> > _mapping.addDataMapping(new DataColumnToPropertyMapping("source",
> > "source"));
> > _mapping
> > }
> >
> > private val ismr: InputStreamMappingResolver = {
> >
> > val ri: ResultSetResourceMappingResolver = new
> > ResultSetResourceMappingResolver()
> > ri.setDataSource(dataSource)
> > ri.setMapping(mapping)
> > println(ri)
> > ri
> > }
> >
> > val compass = conf.map(cf => {
> > try{cf.addMappingResover(ismr)}catch{case _ =>
> > println} ......
> >
> > --
> > Scala中文社区: http://groups.google.com/group/scalacn
> >
>
--
Scala中文社区: http://groups.google.com/group/scalacn
Re: lucene search(Compass) at ESME
Posted by Richard Hirsch <hi...@gmail.com>.
The Compass integration should work and I've tried to get it to work
in the Stax environment. Everything should be configured correctly
(for file-based storage).
I've tried it in the stax environment and wasn't successful. I can see
that compass searches correctly but never finds anything (:-<) It is
definitely a tough jira item.
If you want take a look at Jira again and pick another jira item, you
could do this as well. There are a lot of smaller tasks that I
recently created. Many of them are related to other work you have
done (creating new attributes, etc.). If you could do finish a few of
these items this would be a big help.
By the way, I don't know whether you saw the blog that described our
internationalization efforts (
http://blog.esme.us/internationalization-efforts-begin-esme-in-chinese/)
- I mentioned you by name.
D.
On Sun, Nov 15, 2009 at 4:10 PM, Xuefeng Wu <be...@gmail.com> wrote:
> Hi,
>
> I'm sorry I'm busy these days and didn't do anything about ESME except keep
> an eye on.
>
> Today I have free time and try to resolve
> ESME-101<https://issues.apache.org/jira/browse/ESME-101>.
>
> I learned compass some hours and try to find out why the Search is broken.
> But fail to resolve the defects.
>
> I have a question:
> I think Compass should know how to access the data but I didn't find any
> configure for this.
> Compass provide solution that could integrate with hibernate,JPA,JDBC ect.
> Did we need CompassGps?
>
>
> I'm not family with JPA with Lift, I use JDBC Gps, but failed too, I think
> maybe I miss something....
>
> I added such as:
> val conf = tryo(new CompassConfiguration()
> .configure(Props.get("compass_config_file") openOr
> "/props/compass.cfg.xml")
> .addClass((new Message).clazz))
>
> def dataSource(): DataSource= {
> println("Create datasrouce")
> val bds: BasicDataSource = new BasicDataSource();
> bds.setDriverClassName("com.mysql.jdbc.Driver");
> bds.setUrl("jdbc:mysql://localhost/esme");
> bds.setUsername("esme");
> bds.setPassword("esme");
> bds
> }
>
> val mapping = {
> val _mapping: ResultSetToResourceMapping = new
> ResultSetToResourceMapping();
> _mapping.setAlias("message");
> _mapping.setSelectQuery("select m.id as id, m.text as text, m.source as
> source from esme.message m");
> // maps from a parent_id column to a resource property named parent-id
> _mapping.addIdMapping(new IdColumnToPropertyMapping("id", "id"));
> _mapping.addDataMapping(new DataColumnToPropertyMapping("text",
> "text"));
> _mapping.addDataMapping(new DataColumnToPropertyMapping("source",
> "source"));
> _mapping
> }
>
> private val ismr: InputStreamMappingResolver = {
>
> val ri: ResultSetResourceMappingResolver = new
> ResultSetResourceMappingResolver()
> ri.setDataSource(dataSource)
> ri.setMapping(mapping)
> println(ri)
> ri
> }
>
> val compass = conf.map(cf => {
> try{cf.addMappingResover(ismr)}catch{case _ =>
> println} ......
>
> --
> Scala中文社区: http://groups.google.com/group/scalacn
>