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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]