lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramprakash Ramamoorthy <youngestachie...@gmail.com>
Subject Strange behavior of term queries with StoredFields - 4.1
Date Mon, 11 Feb 2013 12:53:14 GMT
Team,

           I am facing a strange issue with term queries and stored fields.
Here is how I index and fetch the query results,

Case 1 :
  doc.add(new StoredField("published", b.getPublished()));
  Query query = new MatchAllDocsQuery();

  Results : No of hits : 8(Expected)

Case 2 :
  doc.add(new StoredField("published", b.getPublished()));
  Query query = new TermQuery(new Term("published", "2012"));

  Result : No of hits : 0 (Expected - 4)

 Case 3 :
   doc.add(new Field("published", b.getPublished(), fieldType));
   Query query = new TermQuery(new Term("published", "2012"));

    Result : No of hits : 4(Expected)

Does StoredField means only store and no index? But in that case, how does
the match all docs query work? I am puzzled.

I am particular about stored fields, because of the compressed size of the
index. How do I go about this? Or am I missing something that is obviously
basic. Please help.

-- 
With Thanks and Regards,
Ramprakash Ramamoorthy,
India.

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