Package org.apache.lucene.search

Examples of org.apache.lucene.search.Filter


   * @return Lucene Query to be used in a search
   * @see Query
   * @see org.hibernate.search.spatial.Coordinates
   */
  public static Query buildDistanceQuery(Coordinates center, double radius, String fieldName) {
    Filter allFilter = new QueryWrapperFilter( new MatchAllDocsQuery() );
    return new FilteredQuery( new MatchAllDocsQuery(), buildDistanceFilter( allFilter, center, radius, fieldName ) );
  }
View Full Code Here


  private void buildFilters() {
    ChainedFilter chainedFilter = new ChainedFilter();
    if ( !filterDefinitions.isEmpty() ) {
      for ( FullTextFilterImpl fullTextFilter : filterDefinitions.values() ) {
        Filter filter = buildLuceneFilter( fullTextFilter );
        if ( filter != null ) {
          chainedFilter.addFilter( filter );
        }
      }
    }
View Full Code Here

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;

    if ( filter == null ) {
      filter = createFilter( def, instance );
View Full Code Here

  private boolean isPreQueryFilterOnly(FilterDef def) {
    return def.getImpl().equals( ShardSensitiveOnlyFilter.class );
  }

  private Filter createFilter(FilterDef def, Object instance) {
    Filter filter;
    if ( def.getFactoryMethod() != null ) {
      try {
        filter = (Filter) def.getFactoryMethod().invoke( instance );
      }
      catch ( IllegalAccessException e ) {
View Full Code Here

  private void buildFilters() {
    ChainedFilter chainedFilter = new ChainedFilter();
    if ( !filterDefinitions.isEmpty() ) {
      for ( FullTextFilterImpl fullTextFilter : filterDefinitions.values() ) {
        Filter filter = buildLuceneFilter( fullTextFilter );
        if ( filter != null ) {
          chainedFilter.addFilter( filter );
        }
      }
    }
View Full Code Here

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;

    if ( filter == null ) {
      filter = createFilter( def, instance );
View Full Code Here

  private boolean isPreQueryFilterOnly(FilterDef def) {
    return def.getImpl().equals( ShardSensitiveOnlyFilter.class );
  }

  private Filter createFilter(FilterDef def, Object instance) {
    Filter filter;
    if ( def.getFactoryMethod() != null ) {
      try {
        filter = (Filter) def.getFactoryMethod().invoke( instance );
      }
      catch ( IllegalAccessException e ) {
View Full Code Here

  private void buildFilters() {
    ChainedFilter chainedFilter = null;
    if ( !filterDefinitions.isEmpty() ) {
      chainedFilter = new ChainedFilter();
      for ( FullTextFilterImpl fullTextFilter : filterDefinitions.values() ) {
        Filter filter = buildLuceneFilter( fullTextFilter );
        if ( filter != null ) {
          chainedFilter.addFilter( filter );
        }
      }
    }
View Full Code Here

    Object instance = createFilterInstance( fullTextFilter, def );
    FilterKey key = createFilterKey( def, instance );

    // try to get the filter out of the cache
    Filter filter = cacheInstance( def.getCacheMode() ) ?
        searchFactoryImplementor.getFilterCachingStrategy().getCachedFilter( key ) :
        null;

    if ( filter == null ) {
      filter = createFilter( def, instance );
View Full Code Here

  private boolean isPreQueryFilterOnly(FilterDef def) {
    return def.getImpl().equals( ShardSensitiveOnlyFilter.class );
  }

  private Filter createFilter(FilterDef def, Object instance) {
    Filter filter;
    if ( def.getFactoryMethod() != null ) {
      try {
        filter = (Filter) def.getFactoryMethod().invoke( instance );
      }
      catch ( IllegalAccessException e ) {
View Full Code Here

TOP

Related Classes of org.apache.lucene.search.Filter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.