You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Carlos Andrade <ca...@acm.org> on 2013/11/18 20:28:58 UTC

import PyLucene and Introductory Material for Class

Dear All,

I have recently installed pylucene (or so I hope), and I have been trying
to get started on it. Most of the examples I found the web have been using
'import PyLucene', however I have noted that examples from the Lucene
documentation only use 'lucene'. For me, PyLucene does not work for import
on the latest vesion I installed here (Lucene 4.5.1, python 2.7 on a Mac OS
X Lion 10.7.5) but import lucene works.

Was PyLucene deprecated or have I done something wrong along the steps?

Second,

Seeing a talk from one of your conferences:
http://www.youtube.com/watch?v=SCsS5ePGmCs

gave me some hope to introduce Lucene in an Information Retrieval class for
undergrads along with the theoretical concepts such as the one presented
like boolean and vector. Is there any other introductory material to
PyLucene along those lines that could be more oriented for students?

I was planning on creating a small usable example such as this presentation
(http://inkdroid.org/talks/pylucene/) where Lucene is used to index e-mails
(our university has quite a large quantity of e-mails that use this system
so it could be quite interesting for the class as an assignment). But
again, the cited code use PyLucene and so does the 'import mailbox' which
makes the code unusable.

If no such material is available and you could provide me some pointers on
how to get started, I would be glad to contribute it as introductory
material that could be used for other courses if it is of your interest. I
have scanned other courses from other universities but they apparently do
not use this approach.

Best,

Carlos Andrade
http://carlosandrade.co

Re: import PyLucene and Introductory Material for Class

Posted by Carlos Andrade <ca...@acm.org>.
Thanks again. Yes, it was the manindex which I noticed the .org changes :-)
I will see if I can get it done from here.

Best,

Carlos Andrade
http://carlosandrade.co


2013/11/18 Andi Vajda <va...@apache.org>

>
> > On Nov 18, 2013, at 18:52, Carlos Andrade <ca...@acm.org>
> wrote:
> >
> > Thank you for the quick reply Andi Vajda,
> >
> > It is a relief to know that the PyLucene and Lucene import are actually
> > correct! And yes the make test works :-)
> >
> > I will see the book and check the other mailing list to see how it goes.
> To
> > be honest I am a little afraid of trying to install now the previous
> > version, my usual experience on rolling back on my mac on other projects
> > still give me nightmares haha.
>
> You should Python's virtualenv module to avoid such nightmares.
>
> There are sampled in the latest version too, just not the book's.
>
> In particular, the manindex.py and mansearch.py samples that work with all
> the manpages of a unix system could be retooled for your email indexing
> exercise.
>
> > I will see if I can figure out on my own first, if I succeed at least I
> > will get a fresh example out for new comers! And yes, the book should
> help
> > me on getting most of the abstractions in my head set right. I also
> noticed
> > that even with the lucene import on the examples, no one specify the .org
> > path to import classes which also was another cause of not running any
> old
> > code. I guess this was a more recent change.
>
> Yes, that's new with the 4.x release series.
>
> Andi..
>
> >
> > Best,
> >
> > Carlos Andrade
> > http://carlosandrade.co
> >
> >
> > 2013/11/18 Andi Vajda <va...@apache.org>
> >
> >>
> >>>> On Nov 18, 2013, at 17:28, Carlos Andrade <ca...@acm.org>
> >>> wrote:
> >>>
> >>> Dear All,
> >>>
> >>> I have recently installed pylucene (or so I hope), and I have been
> trying
> >>> to get started on it. Most of the examples I found the web have been
> >> using
> >>> 'import PyLucene',
> >>
> >> The web is behind :-)
> >> The 'lucene' module was introduced when PyLucene switched to being built
> >> with JCC,
> >> years ago (2007 ?)
> >>
> >>> however I have noted that examples from the Lucene
> >>> documentation only use 'lucene'. For me, PyLucene does not work for
> >> import
> >>> on the latest vesion I installed here (Lucene 4.5.1, python 2.7 on a
> Mac
> >> OS
> >>> X Lion 10.7.5) but import lucene works.
> >>
> >> You've installed the latest version. Good.
> >>
> >> For instructional purposes, I'd recommend you use the last 3.x release
> >> (3.6.2 iirc) instead, however, because it has most of the "Lucene in
> >> Action" book samples ported to Python.
> >> The 4.x release series API changed too much to make another samples
> >> porting effort worthwhile; the samples need to be rewritten in Java
> first.
> >>
> >>> Was PyLucene deprecated or have I done something wrong along the steps?
> >>
> >> Does 'make test' succeed ?
> >> PyLucene is still the name of the software product but 'lucene' is what
> >> you import.
> >> Take a look at files in the samples or test directories for examples.
> >>
> >>> Second,
> >>>
> >>> Seeing a talk from one of your conferences:
> >>> http://www.youtube.com/watch?v=SCsS5ePGmCs
> >>>
> >>> gave me some hope to introduce Lucene in an Information Retrieval class
> >> for
> >>> undergrads along with the theoretical concepts such as the one
> presented
> >>> like boolean and vector. Is there any other introductory material to
> >>> PyLucene along those lines that could be more oriented for students?
> >>
> >> This is a more generic Lucene question, you should ask it on
> >> java-user@lucene.apache.org, there are a lot more people there that are
> >> able to answer you.
> >>
> >>> I was planning on creating a small usable example such as this
> >> presentation
> >>> (http://inkdroid.org/talks/pylucene/) where Lucene is used to index
> >> e-mails
> >>> (our university has quite a large quantity of e-mails that use this
> >> system
> >>> so it could be quite interesting for the class as an assignment). But
> >>> again, the cited code use PyLucene and so does the 'import mailbox'
> which
> >>> makes the code unusable.
> >>>
> >>> If no such material is available and you could provide me some pointers
> >> on
> >>> how to get started,
> >>
> >> If you know nothing of Lucene, getting the "Lucene in Action" book and
> >> working through the samples is a great way to learn.
> >>
> >> Andi..
> >>
> >>> I would be glad to contribute it as introductory
> >>> material that could be used for other courses if it is of your
> interest.
> >> I
> >>> have scanned other courses from other universities but they apparently
> do
> >>> not use this approach.
> >>>
> >>> Best,
> >>>
> >>> Carlos Andrade
> >>> http://carlosandrade.co
> >>
>

Re: import PyLucene and Introductory Material for Class

Posted by Andi Vajda <va...@apache.org>.
> On Nov 18, 2013, at 18:52, Carlos Andrade <ca...@acm.org> wrote:
> 
> Thank you for the quick reply Andi Vajda,
> 
> It is a relief to know that the PyLucene and Lucene import are actually
> correct! And yes the make test works :-)
> 
> I will see the book and check the other mailing list to see how it goes. To
> be honest I am a little afraid of trying to install now the previous
> version, my usual experience on rolling back on my mac on other projects
> still give me nightmares haha.

You should Python's virtualenv module to avoid such nightmares.

There are sampled in the latest version too, just not the book's.

In particular, the manindex.py and mansearch.py samples that work with all the manpages of a unix system could be retooled for your email indexing exercise.

> I will see if I can figure out on my own first, if I succeed at least I
> will get a fresh example out for new comers! And yes, the book should help
> me on getting most of the abstractions in my head set right. I also noticed
> that even with the lucene import on the examples, no one specify the .org
> path to import classes which also was another cause of not running any old
> code. I guess this was a more recent change.

Yes, that's new with the 4.x release series.

Andi..

> 
> Best,
> 
> Carlos Andrade
> http://carlosandrade.co
> 
> 
> 2013/11/18 Andi Vajda <va...@apache.org>
> 
>> 
>>>> On Nov 18, 2013, at 17:28, Carlos Andrade <ca...@acm.org>
>>> wrote:
>>> 
>>> Dear All,
>>> 
>>> I have recently installed pylucene (or so I hope), and I have been trying
>>> to get started on it. Most of the examples I found the web have been
>> using
>>> 'import PyLucene',
>> 
>> The web is behind :-)
>> The 'lucene' module was introduced when PyLucene switched to being built
>> with JCC,
>> years ago (2007 ?)
>> 
>>> however I have noted that examples from the Lucene
>>> documentation only use 'lucene'. For me, PyLucene does not work for
>> import
>>> on the latest vesion I installed here (Lucene 4.5.1, python 2.7 on a Mac
>> OS
>>> X Lion 10.7.5) but import lucene works.
>> 
>> You've installed the latest version. Good.
>> 
>> For instructional purposes, I'd recommend you use the last 3.x release
>> (3.6.2 iirc) instead, however, because it has most of the "Lucene in
>> Action" book samples ported to Python.
>> The 4.x release series API changed too much to make another samples
>> porting effort worthwhile; the samples need to be rewritten in Java first.
>> 
>>> Was PyLucene deprecated or have I done something wrong along the steps?
>> 
>> Does 'make test' succeed ?
>> PyLucene is still the name of the software product but 'lucene' is what
>> you import.
>> Take a look at files in the samples or test directories for examples.
>> 
>>> Second,
>>> 
>>> Seeing a talk from one of your conferences:
>>> http://www.youtube.com/watch?v=SCsS5ePGmCs
>>> 
>>> gave me some hope to introduce Lucene in an Information Retrieval class
>> for
>>> undergrads along with the theoretical concepts such as the one presented
>>> like boolean and vector. Is there any other introductory material to
>>> PyLucene along those lines that could be more oriented for students?
>> 
>> This is a more generic Lucene question, you should ask it on
>> java-user@lucene.apache.org, there are a lot more people there that are
>> able to answer you.
>> 
>>> I was planning on creating a small usable example such as this
>> presentation
>>> (http://inkdroid.org/talks/pylucene/) where Lucene is used to index
>> e-mails
>>> (our university has quite a large quantity of e-mails that use this
>> system
>>> so it could be quite interesting for the class as an assignment). But
>>> again, the cited code use PyLucene and so does the 'import mailbox' which
>>> makes the code unusable.
>>> 
>>> If no such material is available and you could provide me some pointers
>> on
>>> how to get started,
>> 
>> If you know nothing of Lucene, getting the "Lucene in Action" book and
>> working through the samples is a great way to learn.
>> 
>> Andi..
>> 
>>> I would be glad to contribute it as introductory
>>> material that could be used for other courses if it is of your interest.
>> I
>>> have scanned other courses from other universities but they apparently do
>>> not use this approach.
>>> 
>>> Best,
>>> 
>>> Carlos Andrade
>>> http://carlosandrade.co
>> 

Re: import PyLucene and Introductory Material for Class

Posted by Carlos Andrade <ca...@acm.org>.
Thank you for the quick reply Andi Vajda,

It is a relief to know that the PyLucene and Lucene import are actually
correct! And yes the make test works :-)

I will see the book and check the other mailing list to see how it goes. To
be honest I am a little afraid of trying to install now the previous
version, my usual experience on rolling back on my mac on other projects
still give me nightmares haha.

I will see if I can figure out on my own first, if I succeed at least I
will get a fresh example out for new comers! And yes, the book should help
me on getting most of the abstractions in my head set right. I also noticed
that even with the lucene import on the examples, no one specify the .org
path to import classes which also was another cause of not running any old
code. I guess this was a more recent change.

Best,

Carlos Andrade
http://carlosandrade.co


2013/11/18 Andi Vajda <va...@apache.org>

>
> > On Nov 18, 2013, at 17:28, Carlos Andrade <ca...@acm.org>
> wrote:
> >
> > Dear All,
> >
> > I have recently installed pylucene (or so I hope), and I have been trying
> > to get started on it. Most of the examples I found the web have been
> using
> > 'import PyLucene',
>
> The web is behind :-)
> The 'lucene' module was introduced when PyLucene switched to being built
> with JCC,
> years ago (2007 ?)
>
> > however I have noted that examples from the Lucene
> > documentation only use 'lucene'. For me, PyLucene does not work for
> import
> > on the latest vesion I installed here (Lucene 4.5.1, python 2.7 on a Mac
> OS
> > X Lion 10.7.5) but import lucene works.
>
> You've installed the latest version. Good.
>
> For instructional purposes, I'd recommend you use the last 3.x release
> (3.6.2 iirc) instead, however, because it has most of the "Lucene in
> Action" book samples ported to Python.
> The 4.x release series API changed too much to make another samples
> porting effort worthwhile; the samples need to be rewritten in Java first.
>
> > Was PyLucene deprecated or have I done something wrong along the steps?
>
> Does 'make test' succeed ?
> PyLucene is still the name of the software product but 'lucene' is what
> you import.
> Take a look at files in the samples or test directories for examples.
>
> > Second,
> >
> > Seeing a talk from one of your conferences:
> > http://www.youtube.com/watch?v=SCsS5ePGmCs
> >
> > gave me some hope to introduce Lucene in an Information Retrieval class
> for
> > undergrads along with the theoretical concepts such as the one presented
> > like boolean and vector. Is there any other introductory material to
> > PyLucene along those lines that could be more oriented for students?
>
> This is a more generic Lucene question, you should ask it on
> java-user@lucene.apache.org, there are a lot more people there that are
> able to answer you.
>
> > I was planning on creating a small usable example such as this
> presentation
> > (http://inkdroid.org/talks/pylucene/) where Lucene is used to index
> e-mails
> > (our university has quite a large quantity of e-mails that use this
> system
> > so it could be quite interesting for the class as an assignment). But
> > again, the cited code use PyLucene and so does the 'import mailbox' which
> > makes the code unusable.
> >
> > If no such material is available and you could provide me some pointers
> on
> > how to get started,
>
> If you know nothing of Lucene, getting the "Lucene in Action" book and
> working through the samples is a great way to learn.
>
> Andi..
>
> > I would be glad to contribute it as introductory
> > material that could be used for other courses if it is of your interest.
> I
> > have scanned other courses from other universities but they apparently do
> > not use this approach.
> >
> > Best,
> >
> > Carlos Andrade
> > http://carlosandrade.co
>

Re: import PyLucene and Introductory Material for Class

Posted by Andi Vajda <va...@apache.org>.
> On Nov 18, 2013, at 17:28, Carlos Andrade <ca...@acm.org> wrote:
> 
> Dear All,
> 
> I have recently installed pylucene (or so I hope), and I have been trying
> to get started on it. Most of the examples I found the web have been using
> 'import PyLucene',

The web is behind :-)
The 'lucene' module was introduced when PyLucene switched to being built with JCC,
years ago (2007 ?)

> however I have noted that examples from the Lucene
> documentation only use 'lucene'. For me, PyLucene does not work for import
> on the latest vesion I installed here (Lucene 4.5.1, python 2.7 on a Mac OS
> X Lion 10.7.5) but import lucene works.

You've installed the latest version. Good.

For instructional purposes, I'd recommend you use the last 3.x release (3.6.2 iirc) instead, however, because it has most of the "Lucene in Action" book samples ported to Python. 
The 4.x release series API changed too much to make another samples porting effort worthwhile; the samples need to be rewritten in Java first.

> Was PyLucene deprecated or have I done something wrong along the steps?

Does 'make test' succeed ?
PyLucene is still the name of the software product but 'lucene' is what you import.
Take a look at files in the samples or test directories for examples.

> Second,
> 
> Seeing a talk from one of your conferences:
> http://www.youtube.com/watch?v=SCsS5ePGmCs
> 
> gave me some hope to introduce Lucene in an Information Retrieval class for
> undergrads along with the theoretical concepts such as the one presented
> like boolean and vector. Is there any other introductory material to
> PyLucene along those lines that could be more oriented for students?

This is a more generic Lucene question, you should ask it on java-user@lucene.apache.org, there are a lot more people there that are able to answer you.

> I was planning on creating a small usable example such as this presentation
> (http://inkdroid.org/talks/pylucene/) where Lucene is used to index e-mails
> (our university has quite a large quantity of e-mails that use this system
> so it could be quite interesting for the class as an assignment). But
> again, the cited code use PyLucene and so does the 'import mailbox' which
> makes the code unusable.
> 
> If no such material is available and you could provide me some pointers on
> how to get started,

If you know nothing of Lucene, getting the "Lucene in Action" book and working through the samples is a great way to learn.

Andi..

> I would be glad to contribute it as introductory
> material that could be used for other courses if it is of your interest. I
> have scanned other courses from other universities but they apparently do
> not use this approach.
> 
> Best,
> 
> Carlos Andrade
> http://carlosandrade.co