Package com.dbxml.db.core.indexer

Examples of com.dbxml.db.core.indexer.Indexer


   }

   private Key[] evaluateSelect(Transaction tx, SelectQueryNode node) throws QueryException {
      try {
         IndexPattern pattern = new IndexPattern(context.getSymbols(), node.name, nsMap);
         Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_FULLTEXT, pattern);
         if ( idx != null ) {
            String value = node.value;

            // If it's a FullTextIndexer, check it for stop words instead
            // of querying it for no reason.
            if ( idx instanceof FullTextIndexer ) {
               FullTextIndexer fidx = (FullTextIndexer)idx;
               WordStemmer stemmer = fidx.getWordStemmer();
               if ( stemmer != null )
                  value = stemmer.normalizeCase(value);

               Set stopWords = fidx.getStopWords();
               if ( stopWords != null && stopWords.contains(value) )
                  return null;
            }

            IndexQuery idxQry = new IndexQuery(pattern, node.operator, new Value(node.value));
            IndexMatch[] matches = idx.queryMatches(tx, idxQry);
            return QueryEngine.getUniqueKeys(matches);
         }
         else
            throw new ProcessingException("No FullText Index to support pattern '"+node.name+"'");
      }
View Full Code Here


            if ( nk.keys != null )
               ks.add(nk.keys);
            else if ( name != null ) {
               // Try to use a NameIndex to resolve the path component
               IndexPattern pattern = new IndexPattern(symbols, name, nsMap);
               Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_NODENAME, pattern);
               if ( idx != null ) {
                  IndexMatch[] matches = idx.queryMatches(tx, new IndexQueryANY(pattern));
                  Key[] keys = QueryEngine.getUniqueKeys(matches);
                  ks.add(keys);
               }
            }
         }
View Full Code Here

      try {
         IndexPattern pattern = iq.getPattern();
         if ( pattern.isInvalid() )
            return null;

         Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_NODEVALUE, pattern);
         if ( idx != null ) {
            IndexMatch[] matches = idx.queryMatches(tx, iq);
            Key[] keys = QueryEngine.getUniqueKeys(matches);
            return new NamedKeys(nk.name, nk.attribute, keys);
         }
      }
      catch ( Exception e ) {
View Full Code Here

TOP

Related Classes of com.dbxml.db.core.indexer.Indexer

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.