lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doron Cohen" <cdor...@gmail.com>
Subject Re: Need help searching
Date Sat, 09 Aug 2008 14:59:08 GMT
>
> > writer = new IndexWriter("C:\\", new StandardAnalyzer(), true);
> > Term term = new Term("line", "KOREA");
> > PhraseQuery query = new PhraseQuery();
> > query.add(term);
>

StandardAnalyzer - used here while indexing - applies lowercasing.
The query is created programatically - i.e. without a QueryParser
and in particular without tokenization (~analysis) - and so "KOREA",
while at indexing time would have been lowercased to "korea", at
search time will remain as "KOREA" and hence search will not find it.

For a few more useful hints see the FAQ entry
    "Why am I getting no hits / incorrect hits?"

Doron

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