lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd McGrath" <>
Subject multi-word/phrase filters
Date Wed, 23 Apr 2003 19:41:24 GMT

I'm having trouble with filters that have a Term with more than one word.
I'm using the ChainableFilter contrib and everything is running great when I
filter with a single word.

More info-
Index consists of articles that are associated with particular topics.  So,
topics are stored in the index with a "assocation" Field (along with Fields
for article title, content, etc.)  The "association" Field is a space
separated list of values that indicate what topic(s) the article is
associated. One example list of topics stored in the "assocation" Field is:
topic1 topic2 topic3.   But another assocation Field example list might have
topic names that contain spaces: topic1 topic two topic3 where "topic two"
is a two word topic.

If I filter results, with Filters of "topic1", "topic2", etc. everything
great!  But if I try to filter by "topic two", no results.

Any pointers debugging this is appreciated.  I don't think I'm doing
anything fancy- using StandardAnalyzer and a Filter class with a bits method
that looks like this:

public java.util.BitSet bits(IndexReader reader) throws

	BitSet bits = new BitSet(reader.maxDoc());

	// field will be "association" and text will be "topic1" or "topic two"
	// text is not wrapped in quotes or backslashes, just a String from HTML

	Term filterterm = new Term(field, text);

	TermDocs termDocs = reader.termDocs(filterterm);

	if (termDocs == null) {
		return bits;

	try {
	  while (
	} finally {

	return bits;

I've tried storing "association" in Field.Text, Keyword and Unstored.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message