: But I always thought such code: : : Term term = new Term("text", str); : TermQuery tq = new TermQuery(term); : query.add(tq, Occur.SHOULD); : : would get query terms through analyzers - since they are specified under
the underlying lucene query classes (like TermQuery) don't know anything baout analyzers -- definitely nothing about Solr specific field types. if you think about it: it would be impossible for them to: if you've got a quoted string like "foo bar" you need to analyze it in order to know wether it should be a single TermQuery (because of KeywordTokenizer), a PhraseQuery with two terms (because of whitespace tokenizer), a PhraseQuery with a dozen terms (because of an ngram tokenizer) or a MultiTermPrahseQuery (because of a synonym filter) it's the SolrQueryParser that knows about the FieldTypes in the schema.xml -Hoss