I have news questions:
- apiQuery.add(new TermQuery(new Term("contents", "dot")), false, true);
new Term("contents", "dot")
The Term class, work for only one word?
Careful with terminology here. It works for only one "term". What is a term? That all depends on what happened during analysis. Generally speaking, though, "word" is the right generalization for a "term" - but we have to be careful technically speaking.
new Term("contents", "dot java")
for search for dor OR java in contents.
Wrong. When constructing a query through the API, if you want an OR you'd need to add two TermQuery's to a BooleanQuery, one for each "word" and make them not required.
My problem is that the user, entry a phrase, and i search for any word in a
phrase. No the entire phrase.
I need parse de string?, take word for word and add a TermQuery for each
word?
Yes.
If you have a text string of multiple terms you want added to a boolean query you could do so programatically by analyzing the string as I do in my article in AnalyzerDemo or by parsing it through some other mechanism than QueryParser and add each as a TermQuery. You're on track!
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
