What analyzers are you using for your queries and your indexing? StandardAnalyzer (I believe) will break "A.B" into two tokens , so your index could contain both tags. So what you really have in the index would be story1 A C E story2: A B P Q (note no '.').
searching for B.A would really search for B OR A because of 2 things: 1> the tokenizer (assuming StandardAnalyzer or any other analyzer that breaks tokens at punctuation) would break the query into two terms. 2> the default is OR unless you set the default to AND or specify it in the query. If you're using different analyzers, this is irrelevant. Also, this assumes you're using the query parser. If you haven't already, I *strongly* recommend you get a copy of Luke (google lucene luke). It lets you examine your indexes to see what's actually been indexed and lets you examine queries to see what the actual search terms are. It even lets you use different analyzers to see how they behave when it comes to creating a query. Best Erick On 1/11/07, M A <[EMAIL PROTECTED]> wrote:
Hi, We are having some trouble with the results that we get from certain queries. Basically .. we have documents that we index, each document has a bunch of tags, the tags could be of the sort tags: A, B, C, D.P, E.A etc .. Each story will contain only a subset of the tags .. For example Story 1: tags : A, C, E Story 2: tags : B.A, P, Q (note "B.A" is one tag) . Problem occurs when we run a search with query "A" we get both results, but what we should be getting is just Story 1. Query "B.A" returns the correct value. What would i have to ensure that a search for "A" only matches "A" and not "B.A"? thanx