lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leslie Hughes <Leslie.Hug...@watercorporation.com.au>
Subject PhraseQuery question
Date Wed, 28 May 2003 08:48:54 GMT

Hi,

I'm playing with PhraseQuery on an index of address data. If I do

     PhraseQuery pq = new PhraseQuery();
      pq.add(new Term("SUBURB_NAME","PERTH GPO"));
      log.debug("Searching for: " + pq.toString());
      Hits hits = searcher.search(pq);

I get no hits and debug info of 
Searching for: SUBURB_NAME:"PERTH GPO"

If I do
     PhraseQuery pq = new PhraseQuery();
     pq.add(new Term("SUBURB_NAME","PERTH"));
     pq.add(new Term("SUBURB_NAME","GPO"));
     log.debug("Searching for: " + pq.toString());
     Hits hits = searcher.search(pq);

I get the same debug query string
Searching for: SUBURB_NAME:"PERTH GPO"

but this time I get a bunch of hits back.

I'm using a real simple analyzer for the indexer:-

public final TokenStream tokenStream(String fieldName, Reader reader) {
    return new WhitespaceTokenizer(reader);
}

What's going on?


Bye
Les



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message