How are you breaking up your query? That is, what analyzer are you using for query parsing? Or are you building your own query programmatically?
Also, what about capitalization? Some of the analyzers automatically lower-case the terms, either at index time or query time (or both). If there's a mis-match, you get "strange" results. I suspect what's happening is that your analyzers (either at index time, query time or both) aren't behaving as you assume. I've gotten the most intuitive results, when starting out, using WhitespaceAnalyzer. Once you're comfortable with that analyzer, then think about the more complex ones. And just to make it more confusing, if I understand correctly, when you index UN_TOKENIZED, it doesn't matter what analyzer you use, it's ignored. I might be wrong about this one though..... I recommend downloading luke (google lucene luke). It'll let you look at your index, and have queries parsed by various analyzers (and also explain how the query is interpreted). It'll answer many, many, many questions for you about "what really happened". Best Erick On 10/8/06, Ismail Siddiqui <[EMAIL PROTECTED]> wrote:
Hi All I am trying to index a field which has more than one word with space e.g. "My Word" i am indexng it UN_TOKENIZED .. but when i use TermQuery to query "My Word" its not yielding any result.. if I index it TOKENIZED and use phrase query.. then use phrase query then it yields result on all 3 combination "My" , "Word", "MY Word" but I actually want to show result only on "My Word"... Is term qurey limited to one word? i mean if we index a word with space and index it UN_TOKENIZED.. shouldnt TermQuery yeild result to "My Word". Ismail