You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by xingjian <xi...@gmail.com> on 2007/11/07 02:30:54 UTC
How i can read the index of Nutch by Lucene's IndexReader.
How i can read the index of Nutch by Lucene's IndexReader.
Code:
private String INDEX_STORE_PATH = "D:\\workspace3.3\\Nutch\\crawled\\index";
IndexReader reader = IndexReader.open(INDEX_STORE_PATH);
for(int i=0;i<reader.numDocs();i++){
System.out.println(reader.document(i));
}
when execute above code,error occur:java.io.FileNotFoundException:
D:\workspace3.3\Nutch\crawled\index\segments
My directory "D:\workspace3.3\Nutch\crawled\index\segments" have lists:
_0.fdt
_0.fdx
_0.fnm
_0.frq
_0.nrm
_0.prx
_0.tii
_0.tis
a.txt
segments.gen
segments_2
--
View this message in context: http://www.nabble.com/How-i-can-read-the-index-of-Nutch-by-Lucene%27s-IndexReader.-tf4762078.html#a13619508
Sent from the Nutch - User mailing list archive at Nabble.com.
Re: How i can read the index of Nutch by Lucene's IndexReader.
Posted by xingjian <xi...@gmail.com>.
I try this one:
private String INDEX_STORE_PATH
="D:\\workspace3.3\\Nutch\\crawled\\index\\segments"
replace
private String INDEX_STORE_PATH = "D:\\workspace3.3\\Nutch\\crawled\\index"
but occur :java.io.IOException: D:\workspace3.3\Nutch\crawled\index\segments
not a directory
notice: "D:\workspace3.3\Nutch\crawled\index\segments" have lists:
_0.fdt
_0.fdx
_0.fnm
_0.frq
_0.nrm
_0.prx
_0.tii
_0.tis
a.txt
segments.gen
segments_2
--
View this message in context: http://www.nabble.com/How-i-can-read-the-index-of-Nutch-by-Lucene%27s-IndexReader.-tf4762078.html#a13639455
Sent from the Nutch - User mailing list archive at Nabble.com.
Re: How i can read the index of Nutch by Lucene's IndexReader.
Posted by Milan Krendzelak <mk...@mtld.mobi>.
Hi, I think your path to index, which you pass as parameter, is
incorrect. try this one:
private String INDEX_STORE_PATH ="D:\\workspace3.3\\Nutch\\crawled\
\index\\segments"
As I understand your index is located in subfolder segments....
Cheers,
Milan
On Wed, 2007-11-07 at 10:35 +0100, Karol Rybak wrote:
> Make sure you are using the same lucene version both in nutch and your tool,
> you can check which version nutch uses by going to lib directory of your
> nutch installation
>
> On 11/7/07, xingjian <xi...@gmail.com> wrote:
> >
> >
> > Do you help me?thanks.
> >
> >
> > xingjian wrote:
> > >
> > > How i can read the index info of Nutch by Lucene's IndexReader.
> > >
> > > Code:
> > > private String INDEX_STORE_PATH =
> > > "D:\\workspace3.3\\Nutch\\crawled\\index";
> > > IndexReader reader = IndexReader.open(INDEX_STORE_PATH);
> > > for(int i=0;i<reader.numDocs();i++){
> > > System.out.println(reader.document(i));
> > > }
> > >
> > > when execute above code,error occur:java.io.FileNotFoundException:
> > > D:\workspace3.3\Nutch\crawled\index\segments
> > >
> > > My directory "D:\workspace3.3\Nutch\crawled\index\segments" have lists:
> > > _0.fdt
> > > _0.fdx
> > > _0.fnm
> > > _0.frq
> > > _0.nrm
> > > _0.prx
> > > _0.tii
> > > _0.tis
> > > a.txt
> > > segments.gen
> > > segments_2
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/How-i-can-read-the-index-of-Nutch-by-Lucene%27s-IndexReader.-tf4762078.html#a13623037
> > Sent from the Nutch - User mailing list archive at Nabble.com.
> >
> >
>
>
Re: How i can read the index of Nutch by Lucene's IndexReader.
Posted by Karol Rybak <ka...@gmail.com>.
Make sure you are using the same lucene version both in nutch and your tool,
you can check which version nutch uses by going to lib directory of your
nutch installation
On 11/7/07, xingjian <xi...@gmail.com> wrote:
>
>
> Do you help me?thanks.
>
>
> xingjian wrote:
> >
> > How i can read the index info of Nutch by Lucene's IndexReader.
> >
> > Code:
> > private String INDEX_STORE_PATH =
> > "D:\\workspace3.3\\Nutch\\crawled\\index";
> > IndexReader reader = IndexReader.open(INDEX_STORE_PATH);
> > for(int i=0;i<reader.numDocs();i++){
> > System.out.println(reader.document(i));
> > }
> >
> > when execute above code,error occur:java.io.FileNotFoundException:
> > D:\workspace3.3\Nutch\crawled\index\segments
> >
> > My directory "D:\workspace3.3\Nutch\crawled\index\segments" have lists:
> > _0.fdt
> > _0.fdx
> > _0.fnm
> > _0.frq
> > _0.nrm
> > _0.prx
> > _0.tii
> > _0.tis
> > a.txt
> > segments.gen
> > segments_2
> >
>
> --
> View this message in context:
> http://www.nabble.com/How-i-can-read-the-index-of-Nutch-by-Lucene%27s-IndexReader.-tf4762078.html#a13623037
> Sent from the Nutch - User mailing list archive at Nabble.com.
>
>
--
Karol Rybak
Programista / Programmer
Sekcja aplikacji / Applications section
Wyższa Szkoła Informatyki i Zarządzania / University of Internet Technology
and Management
+48(17)8661277
Re: How i can read the index of Nutch by Lucene's IndexReader.
Posted by xingjian <xi...@gmail.com>.
Do you help me?thanks.
xingjian wrote:
>
> How i can read the index info of Nutch by Lucene's IndexReader.
>
> Code:
> private String INDEX_STORE_PATH =
> "D:\\workspace3.3\\Nutch\\crawled\\index";
> IndexReader reader = IndexReader.open(INDEX_STORE_PATH);
> for(int i=0;i<reader.numDocs();i++){
> System.out.println(reader.document(i));
> }
>
> when execute above code,error occur:java.io.FileNotFoundException:
> D:\workspace3.3\Nutch\crawled\index\segments
>
> My directory "D:\workspace3.3\Nutch\crawled\index\segments" have lists:
> _0.fdt
> _0.fdx
> _0.fnm
> _0.frq
> _0.nrm
> _0.prx
> _0.tii
> _0.tis
> a.txt
> segments.gen
> segments_2
>
--
View this message in context: http://www.nabble.com/How-i-can-read-the-index-of-Nutch-by-Lucene%27s-IndexReader.-tf4762078.html#a13623037
Sent from the Nutch - User mailing list archive at Nabble.com.