lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ilya Zavorin <>
Subject can't find queries when they are one per line in target file
Date Fri, 13 Jul 2012 16:28:19 GMT

I am using 3.4.0 and just discovered a weird issue. I have a set of simple English one-word
queries and two target files that I want to search. One has all these queries in one line,
i.e. something like this

Query1 Query2 Query3 Query4

The other has them one per line, i.e.


The 1st test was to index only the 1st target file and then iterate over all queries. The
2nd test was the same but with the 2nd file. In the first test, I found all the queries, as
expected. In the second one, I found none! More specifically, the block of code

String qStr = "Query1"; // or "Query2" or ...
QueryParser parser = ...;
IndexSearcher searcher = ...;
Query query = parser.parse(qStr);
TopDocs results =, Integer.MAX_VALUE);
ScoreDoc[] hits = results.scoreDocs;

returned no hits for the 2nd test.

Do I have to index the file differently? Or handle the queries differently? Or something else?

Thanks much,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message