/** * Builds a Lucene filter using the given <code>FullTextFilter</code>. * * @param fullTextFilter the Hibernate Search specific <code>FullTextFilter</code>, * referencing the filter to use and providing parameters * @return the filter, as a Lucene <code>Query</code>. */ private Query buildLuceneFilter(FullTextFilterImpl fullTextFilter) { /* * FilterKey implementations and Filter(Factory) do not have to be threadsafe wrt their parameter injection * as FilterCachingStrategy ensure a memory barrier between concurrent thread calls */ FilterDef def = extendedIntegrator.getFilterDefinition( fullTextFilter.getName() ); //def can never be null, it's guarded by enableFullTextFilter(String) if ( isPreQueryFilterOnly( def ) ) { return null; } if ( !cacheInstance( def.getCacheMode() ) ) { Object filterOrFactory = createFilterInstance( fullTextFilter, def ); return createFilterQuery( def, filterOrFactory ); } else { return createOrGetLuceneFilterFromCache( fullTextFilter, def ); } }
/** * Builds a Lucene filter using the given <code>FullTextFilter</code>. * * @param fullTextFilter the Hibernate Search specific <code>FullTextFilter</code>, * referencing the filter to use and providing parameters * @return the filter, as a Lucene <code>Query</code>. */ private Query buildLuceneFilter(FullTextFilterImpl fullTextFilter) { /* * FilterKey implementations and Filter(Factory) do not have to be threadsafe wrt their parameter injection * as FilterCachingStrategy ensure a memory barrier between concurrent thread calls */ FilterDef def = extendedIntegrator.getFilterDefinition( fullTextFilter.getName() ); //def can never be null, it's guarded by enableFullTextFilter(String) if ( isPreQueryFilterOnly( def ) ) { return null; } if ( !cacheInstance( def.getCacheMode() ) ) { Object filterOrFactory = createFilterInstance( fullTextFilter, def ); return createFilterQuery( def, filterOrFactory ); } else { return createOrGetLuceneFilterFromCache( fullTextFilter, def ); } }