1 <?xml version="1.0" encoding="UTF-8"?>
4 <BooleanQuery fieldName="contents">
5 <Clause occurs="should">
6 <TermQuery>merger</TermQuery>
8 <Clause occurs="mustnot">
9 <TermQuery >sumitomo</TermQuery>
16 CachedFilter elements can contain any Query or Filter.
17 CachedFilters are cached in an LRU Cache keyed on the contained query/filter object.
18 Using this will speed up overall performance for repeated uses of the same expensive
19 query/filter. The sorts of queries likely to benefit from caching need not necessarily be
20 complex - e.g. simple TermQuerys with a large DF (document frequency) can be expensive
21 on large indexes. A good example of this might be a term query on a field with only 2 possible
22 values - "true" or "false". In a large index, querying or filtering on this field requires
23 reading millions of document ids from disk which can more usefully be cached as a
26 For Queries/Filters to be cached and reused the object must implement hashcode and
27 equals methods correctly so that duplicate queries/filters can be detected in the cache.
29 The CoreParser.maxNumCachedFilters property can be used to control the size
30 of the LRU Cache established during the construction of CoreParser instances.
33 <!-- Example query to be cached for fast, repeated use -->
34 <TermQuery fieldName="contents">bank</TermQuery>
35 <!-- Alternatively, a filter object can be cached ....
36 <RangeFilter fieldName="date" lowerTerm="19870409" upperTerm="19870412"/>