I am trying to find a match using one word as a query but it can't seem to find it. I am using standard analyzer but can't find the exact result.
My indexed document is:
Document d = new Document();
d.add(new StringField("content","The quick brown fox jumps over the lazy dog"));
If I use a WildCard Query:
Term term = new Term("content","The*");
Query q = new WildcardQuery(term);
It will return the content: "The quick brown fox jumps over the lazy dog"
If I use a TermQuery :
Term term = new Term("content","The quick brown fox jumps over the lazy dog");
Query q = new TermQuery(term);
It will return the content: "The quick brown fox jumps over the lazy dog"
Now, I want to use "fox" as my new term
Term term= new Term("content","fox");
But I don't know which is the right query to use, or how to do it. I already tried QueryParser, TermQuery, and MultiPhrase but still no luck.
Any help will do or guide. Or just a simple query which I can use as a guide. I have read a lot of tutorials but can't find the right one. I am using lucene 5.0.