Hi, I have the following test case point to the index generated in our application. The result is confusing me and I don't know the reason.
Lucene version: 2.9.0 JDK 1.6.0_18 public class IndexTest1 { public static void main(String[] args) { try { FSDirectory directory = FSDirectory.open(new File("/path_to_index_files")); IndexSearcher searcher = new IndexSearcher(directory, true); PerFieldAnalyzerWrapper wrapper = new PerFieldAnalyzerWrapper(new StandardAnalyzer()); wrapper.addAnalyzer("f1string_sif", new KeywordAnalyzer()); wrapper.addAnalyzer("f2string_ti", new StandardAnalyzer(Version.LUCENE_CURRENT)); Query query = new QueryParser("f1string_sif", new StandardAnalyzer(Version.LUCENE_CURRENT)).parse("f2string_ti:subbank*"); System.out.println("query = " + query); System.out.println("hits = " + searcher.search(query, 100).totalHits); searcher.close(); } catch (Exception e) { System.out.println(e); } } } Output: query = f2string_ti:subbank* hits = 6 If I change the line to the following: Query query = new QueryParser("f1string_sif", new StandardAnalyzer(Version.LUCENE_CURRENT)).parse("f2string_ti:rdmap*"); Output: query = f2string_ti:rdmap* hits = 4 The above result are both correct based on my data. Now if I change the line to: Query query = new QueryParser("f1string_sif", new StandardAnalyzer(Version.LUCENE_CURRENT)).parse("f2string_ti:subbank* OR f2string_ti:rdmap*"); Output: query = f2string_ti:subbank* f2string_ti:rdmap* hits = 2 I assume the count in the last result should be larger than max(6,4), but it is 2. Any reason for that? Thanks _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/201469227/direct/01/