Home > Back-end >  Urgent rescue methods, bosses, please look it, thanks!
Urgent rescue methods, bosses, please look it, thanks!

Time:09-24

Void AddNews (url String, the String title) throws the Exception {
The Document _doc=new Document ();
Field titleField=new Field (" title ", the title of the Store. YES, Index, ANALYZED);
Field urlField=new Field (" url ", url and Store. YES, Index, ANALYZED);

_doc. Add (titleField);
_doc. Add (urlField);
_writer. AddDocument (_doc);
}


Code is ANALYZED according to ANALYZED "always be resolved or is not a field" error

CodePudding user response:

ANALYZED the variable is undefined

CodePudding user response:

Check out the Index to see whether there was ANALYZED the variables in the class

CodePudding user response:

Ok, now solve the problem, thank you