I am using those code below for searching but some methods shows error;
FSDirectory.open(new File(indexDirectoryPath));
writer = new IndexWriter(indexDirectory,
new StandardAnalyzer(),true,
IndexWriter.MaxFieldLength.UNLIMITED);
In this code open and MaxFieldLength shows error. I am using lucene 6.0.0.
The open() method shows the error
The method open(Path) in the type FSDirectory is not applicable for
the arguments (File)
and MaxFieldLength shows:
MaxFieldLength cannot be resolved or is not a field
I used the code provided here:
http://www.tutorialspoint.com/lucene/lucene_first_application.htm
解决方案
Probably the code is written against an older version of lucene.
Newer versions have switched form the old java io to the java nio.
So you would use something like this:FSDirectory.open(FileSystems.getDefault().getPath("yourPath", "index")
In version 6.0 the IndexWriter hasn't got a member called MaxFieldLength Please see Lucene IndexWriter API.
More help can be found in the migration guide
You may wan't to look up older versions of the migration guides as well.