: document accordingly. This works good in most cases. but we had a case where : we ran into issue. : : DocA // Common title and is same for all county so no additional titles. : <title.0>Fighter<title.0> : : DocB : <title.0>The Ultimate Street Fighter<title.0> // Default : <title.1>Ultimate Fighter<title.1> // For UK : : : now querying for UK user q=(title.0:"Fighter"^50 OR title.1:"Fighter"^100) : DocB shows 1st as it scores higher but user is expecting DocA
FYI: The crux of your problem is that when a document matches both title.0 and title.X, you give it a score that is sum of the scores of hte sub queries, but when a document only matches title.0, you only give it the score from that sub-query *and* because of the coord factor, you penalize it for not having a match in the title.X field. if you use the dismax/edismax qparser (or write your own QParser that uses builds DisjunctionMaxQuery objects) you can say "i want the score of the document to be based on whichever sub-query scores the highest, and ignore hte other sub-queries) and there is no coord factor penalty. Note however, that if the boosts you use between the title.0 and title.X field clauses are really disperate, then you may still run into problems One approach to overcoming hte bias against docs with only a general title, would be to change your indexing strategy so that actually cpy title.0 into all of the other title.X fields when there is no country specific title. Another approach might be to index a special field for each doc indicating which countries it has a special title for, and then boosting documents where that field does *not* match on the users country. (or as Erick mentioned: you can use the function query support to build up some really interesting conditional logic on what matches and what scores you give) -Hoss