You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Seid Mohammed <se...@gmail.com> on 2009/02/19 16:41:06 UTC

Indexer.Java problem

I am using netbeans on windows to test lucene.
I have added all the lib files from the /lib directory to my project library.
down the end of Indexer.java program, it states the Field.Text method
is not available
the error message is as follows
---------------------------------------------------------------------------------------------------------------

C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18: duplicate
class: lia.meetlucene.Indexer
public class Indexer {
C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:80:
cannot find symbol
symbol  : method Text(java.lang.String,java.io.FileReader)
location: class org.apache.lucene.document.Field
    doc.add(Field.Text("contents", new FileReader(f)));
C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:81:
cannot find symbol
symbol  : method Keyword(java.lang.String,java.lang.String)
location: class org.apache.lucene.document.Field
    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
Note: C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java
uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors
BUILD FAILED (total time: 2 seconds)
-----------------------------------------------------------------------------------------------------------------------------------
what is wrong?
it underlines in red for the folowing code....
=========================================================
    Document doc = new Document();
    doc.add(Field.Text("contents", new FileReader(f)));
    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
    writer.addDocument(doc);
===================================================

seid m
-- 
"RABI ZIDNI ILMA"

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Indexer.Java problem

Posted by Seid Mohammed <se...@gmail.com>.
tanks erick
i have got the latest INDEXER example from lia2 working properly
thanks a lot

Seid M

On 2/19/09, Michael McCandless <lu...@mikemccandless.com> wrote:
>
> The early access version of LIA2 (accessible at
> http://www.manning.com/hatcher3/)
>   has updated this example to work with recent Lucene releases (though
> it's still using deprecated APIs -- that'll be fixed before the book
> is released).
>
> Oh actually the first chapter is a free PDF on Manning's site.
>
> Mike
>
> Erick Erickson wrote:
>
>> Unfortunately, not really. I haven't tried to get the LIA examples
>> working for years...
>>
>> The various release notes on the Wiki, especially the 1.9 and 2.0
>> release
>> notes are probably the best place to start.
>>
>> Best
>> Erick
>>
>> On Thu, Feb 19, 2009 at 11:13 AM, Seid Mohammed <se...@gmail.com>
>> wrote:
>>
>>> I better modify it, but can you give just a hint on how to modify
>>> thanks a lot
>>>
>>> Seid M
>>>
>>> On 2/19/09, Erick Erickson <er...@gmail.com> wrote:
>>>> LIA was written for a pretty early version of Lucene, if you're
>>>> using a
>>>> recent
>>>> release you need to modify the code to be compliant with that
>>>> version.
>>>>
>>>> Or install an older release of Lucene.
>>>>
>>>> Erick
>>>>
>>>> On Thu, Feb 19, 2009 at 10:41 AM, Seid Mohammed <se...@gmail.com>
>>> wrote:
>>>>
>>>>> I am using netbeans on windows to test lucene.
>>>>> I have added all the lib files from the /lib directory to my
>>>>> project
>>>>> library.
>>>>> down the end of Indexer.java program, it states the Field.Text
>>>>> method
>>>>> is not available
>>>>> the error message is as follows
>>>>>
>>>>>
>>> ---------------------------------------------------------------------------------------------------------------
>>>>>
>>>>> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18:
>>>>> duplicate
>>>>> class: lia.meetlucene.Indexer
>>>>> public class Indexer {
>>>>>
>>>>>
>>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene
>>> \Indexer.java:80:
>>>>> cannot find symbol
>>>>> symbol  : method Text(java.lang.String,java.io.FileReader)
>>>>> location: class org.apache.lucene.document.Field
>>>>>   doc.add(Field.Text("contents", new FileReader(f)));
>>>>>
>>>>>
>>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene
>>> \Indexer.java:81:
>>>>> cannot find symbol
>>>>> symbol  : method Keyword(java.lang.String,java.lang.String)
>>>>> location: class org.apache.lucene.document.Field
>>>>>   doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>>>>> Note:
>>>>>
>>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene
>>> \Indexer.java
>>>>> uses or overrides a deprecated API.
>>>>> Note: Recompile with -Xlint:deprecation for details.
>>>>> 3 errors
>>>>> BUILD FAILED (total time: 2 seconds)
>>>>>
>>>>>
>>> -----------------------------------------------------------------------------------------------------------------------------------
>>>>> what is wrong?
>>>>> it underlines in red for the folowing code....
>>>>> =========================================================
>>>>>   Document doc = new Document();
>>>>>   doc.add(Field.Text("contents", new FileReader(f)));
>>>>>   doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>>>>>   writer.addDocument(doc);
>>>>> ===================================================
>>>>>
>>>>> seid m
>>>>> --
>>>>> "RABI ZIDNI ILMA"
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> "RABI ZIDNI ILMA"
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>


-- 
"RABI ZIDNI ILMA"

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Indexer.Java problem

Posted by Michael McCandless <lu...@mikemccandless.com>.
The early access version of LIA2 (accessible at http://www.manning.com/hatcher3/) 
  has updated this example to work with recent Lucene releases (though  
it's still using deprecated APIs -- that'll be fixed before the book  
is released).

Oh actually the first chapter is a free PDF on Manning's site.

Mike

Erick Erickson wrote:

> Unfortunately, not really. I haven't tried to get the LIA examples
> working for years...
>
> The various release notes on the Wiki, especially the 1.9 and 2.0  
> release
> notes are probably the best place to start.
>
> Best
> Erick
>
> On Thu, Feb 19, 2009 at 11:13 AM, Seid Mohammed <se...@gmail.com>  
> wrote:
>
>> I better modify it, but can you give just a hint on how to modify
>> thanks a lot
>>
>> Seid M
>>
>> On 2/19/09, Erick Erickson <er...@gmail.com> wrote:
>>> LIA was written for a pretty early version of Lucene, if you're  
>>> using a
>>> recent
>>> release you need to modify the code to be compliant with that  
>>> version.
>>>
>>> Or install an older release of Lucene.
>>>
>>> Erick
>>>
>>> On Thu, Feb 19, 2009 at 10:41 AM, Seid Mohammed <se...@gmail.com>
>> wrote:
>>>
>>>> I am using netbeans on windows to test lucene.
>>>> I have added all the lib files from the /lib directory to my  
>>>> project
>>>> library.
>>>> down the end of Indexer.java program, it states the Field.Text  
>>>> method
>>>> is not available
>>>> the error message is as follows
>>>>
>>>>
>> ---------------------------------------------------------------------------------------------------------------
>>>>
>>>> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18:  
>>>> duplicate
>>>> class: lia.meetlucene.Indexer
>>>> public class Indexer {
>>>>
>>>>
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
>> \Indexer.java:80:
>>>> cannot find symbol
>>>> symbol  : method Text(java.lang.String,java.io.FileReader)
>>>> location: class org.apache.lucene.document.Field
>>>>   doc.add(Field.Text("contents", new FileReader(f)));
>>>>
>>>>
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
>> \Indexer.java:81:
>>>> cannot find symbol
>>>> symbol  : method Keyword(java.lang.String,java.lang.String)
>>>> location: class org.apache.lucene.document.Field
>>>>   doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>>>> Note:
>>>>
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
>> \Indexer.java
>>>> uses or overrides a deprecated API.
>>>> Note: Recompile with -Xlint:deprecation for details.
>>>> 3 errors
>>>> BUILD FAILED (total time: 2 seconds)
>>>>
>>>>
>> -----------------------------------------------------------------------------------------------------------------------------------
>>>> what is wrong?
>>>> it underlines in red for the folowing code....
>>>> =========================================================
>>>>   Document doc = new Document();
>>>>   doc.add(Field.Text("contents", new FileReader(f)));
>>>>   doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>>>>   writer.addDocument(doc);
>>>> ===================================================
>>>>
>>>> seid m
>>>> --
>>>> "RABI ZIDNI ILMA"
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>>
>>>>
>>>
>>
>>
>> --
>> "RABI ZIDNI ILMA"
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Indexer.Java problem

Posted by Erick Erickson <er...@gmail.com>.
Unfortunately, not really. I haven't tried to get the LIA examples
working for years...

The various release notes on the Wiki, especially the 1.9 and 2.0 release
notes are probably the best place to start.

Best
Erick

On Thu, Feb 19, 2009 at 11:13 AM, Seid Mohammed <se...@gmail.com> wrote:

> I better modify it, but can you give just a hint on how to modify
> thanks a lot
>
> Seid M
>
> On 2/19/09, Erick Erickson <er...@gmail.com> wrote:
> > LIA was written for a pretty early version of Lucene, if you're using a
> > recent
> > release you need to modify the code to be compliant with that version.
> >
> > Or install an older release of Lucene.
> >
> > Erick
> >
> > On Thu, Feb 19, 2009 at 10:41 AM, Seid Mohammed <se...@gmail.com>
> wrote:
> >
> >> I am using netbeans on windows to test lucene.
> >> I have added all the lib files from the /lib directory to my project
> >> library.
> >> down the end of Indexer.java program, it states the Field.Text method
> >> is not available
> >> the error message is as follows
> >>
> >>
> ---------------------------------------------------------------------------------------------------------------
> >>
> >> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18: duplicate
> >> class: lia.meetlucene.Indexer
> >> public class Indexer {
> >>
> >>
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:80:
> >> cannot find symbol
> >> symbol  : method Text(java.lang.String,java.io.FileReader)
> >> location: class org.apache.lucene.document.Field
> >>    doc.add(Field.Text("contents", new FileReader(f)));
> >>
> >>
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:81:
> >> cannot find symbol
> >> symbol  : method Keyword(java.lang.String,java.lang.String)
> >> location: class org.apache.lucene.document.Field
> >>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
> >> Note:
> >>
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java
> >> uses or overrides a deprecated API.
> >> Note: Recompile with -Xlint:deprecation for details.
> >> 3 errors
> >> BUILD FAILED (total time: 2 seconds)
> >>
> >>
> -----------------------------------------------------------------------------------------------------------------------------------
> >> what is wrong?
> >> it underlines in red for the folowing code....
> >> =========================================================
> >>    Document doc = new Document();
> >>    doc.add(Field.Text("contents", new FileReader(f)));
> >>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
> >>    writer.addDocument(doc);
> >> ===================================================
> >>
> >> seid m
> >> --
> >> "RABI ZIDNI ILMA"
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>
>
> --
> "RABI ZIDNI ILMA"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Indexer.Java problem

Posted by Seid Mohammed <se...@gmail.com>.
I better modify it, but can you give just a hint on how to modify
thanks a lot

Seid M

On 2/19/09, Erick Erickson <er...@gmail.com> wrote:
> LIA was written for a pretty early version of Lucene, if you're using a
> recent
> release you need to modify the code to be compliant with that version.
>
> Or install an older release of Lucene.
>
> Erick
>
> On Thu, Feb 19, 2009 at 10:41 AM, Seid Mohammed <se...@gmail.com> wrote:
>
>> I am using netbeans on windows to test lucene.
>> I have added all the lib files from the /lib directory to my project
>> library.
>> down the end of Indexer.java program, it states the Field.Text method
>> is not available
>> the error message is as follows
>>
>> ---------------------------------------------------------------------------------------------------------------
>>
>> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18: duplicate
>> class: lia.meetlucene.Indexer
>> public class Indexer {
>>
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:80:
>> cannot find symbol
>> symbol  : method Text(java.lang.String,java.io.FileReader)
>> location: class org.apache.lucene.document.Field
>>    doc.add(Field.Text("contents", new FileReader(f)));
>>
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:81:
>> cannot find symbol
>> symbol  : method Keyword(java.lang.String,java.lang.String)
>> location: class org.apache.lucene.document.Field
>>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>> Note:
>> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java
>> uses or overrides a deprecated API.
>> Note: Recompile with -Xlint:deprecation for details.
>> 3 errors
>> BUILD FAILED (total time: 2 seconds)
>>
>> -----------------------------------------------------------------------------------------------------------------------------------
>> what is wrong?
>> it underlines in red for the folowing code....
>> =========================================================
>>    Document doc = new Document();
>>    doc.add(Field.Text("contents", new FileReader(f)));
>>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>>    writer.addDocument(doc);
>> ===================================================
>>
>> seid m
>> --
>> "RABI ZIDNI ILMA"
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>


-- 
"RABI ZIDNI ILMA"

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Indexer.Java problem

Posted by Erick Erickson <er...@gmail.com>.
LIA was written for a pretty early version of Lucene, if you're using a
recent
release you need to modify the code to be compliant with that version.

Or install an older release of Lucene.

Erick

On Thu, Feb 19, 2009 at 10:41 AM, Seid Mohammed <se...@gmail.com> wrote:

> I am using netbeans on windows to test lucene.
> I have added all the lib files from the /lib directory to my project
> library.
> down the end of Indexer.java program, it states the Field.Text method
> is not available
> the error message is as follows
>
> ---------------------------------------------------------------------------------------------------------------
>
> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18: duplicate
> class: lia.meetlucene.Indexer
> public class Indexer {
>
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:80:
> cannot find symbol
> symbol  : method Text(java.lang.String,java.io.FileReader)
> location: class org.apache.lucene.document.Field
>    doc.add(Field.Text("contents", new FileReader(f)));
>
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java:81:
> cannot find symbol
> symbol  : method Keyword(java.lang.String,java.lang.String)
> location: class org.apache.lucene.document.Field
>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
> Note:
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene\Indexer.java
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> 3 errors
> BUILD FAILED (total time: 2 seconds)
>
> -----------------------------------------------------------------------------------------------------------------------------------
> what is wrong?
> it underlines in red for the folowing code....
> =========================================================
>    Document doc = new Document();
>    doc.add(Field.Text("contents", new FileReader(f)));
>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>    writer.addDocument(doc);
> ===================================================
>
> seid m
> --
> "RABI ZIDNI ILMA"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Indexer.Java problem

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Also, the first several hits here provide the tricks to update the  
code to the latest API:

    <http://www.lucidimagination.com/search/?q=lucene+in+action+examples+update 
 >  :)

	Erik


On Feb 19, 2009, at 10:41 AM, Seid Mohammed wrote:

> I am using netbeans on windows to test lucene.
> I have added all the lib files from the /lib directory to my project  
> library.
> down the end of Indexer.java program, it states the Field.Text method
> is not available
> the error message is as follows
> ---------------------------------------------------------------------------------------------------------------
>
> C:\backup\msc\year2sem1\JavSrc\Lucene\src\Indexer.java:18: duplicate
> class: lia.meetlucene.Indexer
> public class Indexer {
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
> \Indexer.java:80:
> cannot find symbol
> symbol  : method Text(java.lang.String,java.io.FileReader)
> location: class org.apache.lucene.document.Field
>    doc.add(Field.Text("contents", new FileReader(f)));
> C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
> \Indexer.java:81:
> cannot find symbol
> symbol  : method Keyword(java.lang.String,java.lang.String)
> location: class org.apache.lucene.document.Field
>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
> Note: C:\backup\msc\luceninaction\LuceneInAction\src\lia\meetlucene 
> \Indexer.java
> uses or overrides a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> 3 errors
> BUILD FAILED (total time: 2 seconds)
> -----------------------------------------------------------------------------------------------------------------------------------
> what is wrong?
> it underlines in red for the folowing code....
> =========================================================
>    Document doc = new Document();
>    doc.add(Field.Text("contents", new FileReader(f)));
>    doc.add(Field.Keyword("filename", f.getCanonicalPath()));
>    writer.addDocument(doc);
> ===================================================
>
> seid m
> -- 
> "RABI ZIDNI ILMA"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org