Package com.dbxml.db.core.indexer

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


      }
   }

   public IndexMatch[] queryMatches(Transaction tx, final IndexQuery query) throws DBException {
      final List results = new ArrayList(128);
      final IndexPattern pattern = query.getPattern();

      try {
         query(tx, query, new BTreeCallback() {
            public void indexInfo(Value value, Value extra) {
               results.add(new IndexMatch(new Key(value), pattern));
View Full Code Here


               try {
                  IndexMatch match = getIndexMatch(extra);
                  if ( !wildcard )
                     results.add(match);
                  else {
                     IndexPattern pt = new IndexPattern(symbols, match.getElement(), match.getAttribute());
                     if ( pt.getMatchLevel(query.getPattern()) > 0 )
                        results.add(match);
                  }
               }
               catch ( Exception e ) {
                  e.printStackTrace(System.err);
View Full Code Here

               try {
                  IndexMatch match = getIndexMatch(extra);
                  if ( !wildcard )
                     results.add(match);
                  else {
                     IndexPattern pt = new IndexPattern(symbols, match.getElement(), match.getAttribute());
                     if ( pt.getMatchLevel(query.getPattern()) > 0 )
                        results.add(match);
                  }
               }
               catch ( Exception e ) {
                  e.printStackTrace(System.err);
View Full Code Here

         throw new ProcessingException("Why are there no children?");
   }

   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
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

            if ( nk.attribute && nk.name.indexOf('@') == -1 )
               ps = owner + "@" + nk.name;
            else
               ps = nk.name;

            IndexPattern pattern = new IndexPattern(symbols, ps, nsMap);

            XObject obj = (XObject)s;
            Value val1 = new Value(obj.str());

            IndexQuery iq = new IndexQuerySW(pattern, val1);
View Full Code Here

    * @param objType The object type to possibly use for index gen
    * @return The resulting Keys (if any)
    */
   private Object queryIndexes(Transaction tx, NamedKeys nk, IndexQuery iq) {
      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);
View Full Code Here

         ps = owner + "@" + nk.name;
      else
         ps = nk.name;

      IndexQuery iq;
      IndexPattern pattern = new IndexPattern(symbols, ps, nsMap);

      Value value = new Value(obj.str());

      switch ( op ) {
         case IndexQuery.NEQ:
View Full Code Here

TOP

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

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.