Hi,
I have the following code and would appreciate your advice.
QueryParser queryParser = new QueryParser(searchTerm, analyzer);
Query query = queryParser.parse(searchTerm);
My first question is, this "doubled"? As I have the "String to search for (=searchTerm)" in the constructor as well as in the parse() method. Is this really required? (For further usage i need a Query object). If i do it this way, does this maybe even introduce some negative side effects?
And I am not able to specify programatically the "default field" to search for. In my quries I write "content:House" and it searches in the field "content". But how can I specify this programatically that "content:" is my default field and a user only has to enter "House" (and lucene then automatically searches in the "content" field).
thank you so much jan