Package org.apache.lucene.search

Examples of org.apache.lucene.search.Filter


    }

    SolrIndexSearcher.ProcessedFilter pf = searcher.getProcessedFilter(
        queryCommand.getFilter(), queryCommand.getFilterList()
    );
    Filter luceneFilter = pf.filter;
    Query query = QueryUtils.makeQueryable(queryCommand.getQuery());

    if (truncateGroups && nrOfCommands > 0) {
      docSet = computeGroupedDocSet(query, luceneFilter, collectors);
    } else if (needDocset) {
View Full Code Here


  }

  public Filter getTopFilter() {
    final OpenBitSet bs = getBits();

    return new Filter() {
      @Override
      public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
        int offset = 0;
        SolrIndexReader r = (SolrIndexReader)reader;
        while (r.getParent() != null) {
View Full Code Here

    return low;
  }

  @Override
  public Filter getTopFilter() {
    return new Filter() {
      int lastEndIdx = 0;

      @Override
      public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
        int offset = 0;
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

  public static Filter parseFilter(String table, String filterStr, boolean superQueryOn, FieldManager fieldManager, BlurFilterCache filterCache, TableContext tableContext) throws ParseException, BlurException {
    if (filterStr == null) {
      return null;
    }
    synchronized (filterCache) {
      Filter filter;
      if (superQueryOn) {
        filter = filterCache.fetchPostFilter(table, filterStr);
      } else {
        filter = filterCache.fetchPreFilter(table, filterStr);
      }
View Full Code Here

      CacheQuery cacheQuery = Search.getSearchManager(cache).getQuery(luceneQuery);
      List<Object> found = cacheQuery.list();

      assert found.size() == 2;

      Filter filter = new PrefixFilter(new Term("blurb", "cheese"));

      cacheQuery.filter(filter);

      found = cacheQuery.list();
View Full Code Here

      return; // there is nothing to do if we don't have any filter definitions
    }

    ChainedFilter chainedFilter = new ChainedFilter();
    for (FullTextFilterImpl fullTextFilter : filterDefinitions.values()) {
      Filter filter = buildLuceneFilter(fullTextFilter);
      chainedFilter.addFilter( filter );
    }

    if ( filter != null ) chainedFilter.addFilter( filter );
    filter = chainedFilter;
View Full Code Here

    FilterDef def = searchFactoryImplementor.getFilterDefinition( fullTextFilter.getName() );
    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

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.