home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Lucene example source code file (TermsFilterQuery.xml)

This example Lucene source code file (TermsFilterQuery.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Lucene tags/keywords

an, as, booleanquery, booleanquery, clause, clause, filter, filteredquery, query, termquery, termquery, termsfilter, termsfilter, utf-8

The Lucene TermsFilterQuery.xml source code

<?xml version="1.0" encoding="UTF-8"?>
		<BooleanQuery fieldName="contents">
			<Clause occurs="should">
			<Clause occurs="must">
		<!-- TermsFilter uses an analyzer to tokenize Field text and creates a filter for docs which 
			have ANY of the supplied terms. Unlike a RangeFilter this can be used for filtering on 
			multiple terms that are not necessarily in a sequence. An example might be a list of primary
			keys from a database query result or perhaps a choice of "category" labels picked by the end 
			As a filter, this is much faster than the equivalent query (a BooleanQuery with many 
			"should" TermQueries)
			This example might be just a list of Saturdays ie not a contiguous range of values
			which can be handled by rangefilter
		<TermsFilter fieldName="date">			
			19870601 19870608 19870615

Other Lucene examples (source code examples)

Here is a short list of links related to this Lucene TermsFilterQuery.xml source code file:

my book on functional programming


new blog posts


Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.