Package org.exist.indexing.ngram

Examples of org.exist.indexing.ngram.NGramIndexWorker


        if (args[0].isEmpty())
            return Sequence.EMPTY_SEQUENCE;

        FunctionReference func = (FunctionReference) args[1].itemAt(0);

        NGramIndexWorker index = (NGramIndexWorker) context.getBroker().getIndexController().getWorkerByIndexId(NGramIndex.ID);
        MemTreeBuilder builder = context.getDocumentBuilder();
        DocumentBuilderReceiver docBuilder = new DocumentBuilderReceiver(builder);
        MatchCallback matchCb = new MatchCallback(func, docBuilder);
        Serializer serializer = context.getBroker().getSerializer();
        serializer.reset();
        ValueSequence result = new ValueSequence();
        for (SequenceIterator i = args[0].iterate(); i.hasNext(); ) {
            NodeValue v = (NodeValue) i.nextItem();
            try {
                int nodeNr = builder.getDocument().getLastNode();
                if (v.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
                    ((NodeImpl)v).copyTo(context.getBroker(), docBuilder);
                } else {
                    NodeProxy p = (NodeProxy) v;
                    MatchListener ml = index.getMatchListener(context.getBroker(), p, matchCb);
                    Receiver receiver;
                    if (ml == null)
                        receiver = docBuilder;
                    else {
                        ml.setNextInChain(docBuilder);
View Full Code Here


        // the expression can be called multiple times, so we need to clear the previous preselectResult
        preselectResult = null;

        long start = System.currentTimeMillis();

        NGramIndexWorker index = (NGramIndexWorker) context.getBroker().getIndexController().getWorkerByIndexId(
            NGramIndex.ID);
        DocumentSet docs = contextSequence.getDocumentSet();
        String key = getArgument(1).eval(contextSequence).getStringValue();
        List<QName> qnames = new ArrayList<QName>(1);
        qnames.add(contextQName);
View Full Code Here

                result = NodeSet.EMPTY_SET;
            else {
                long start = System.currentTimeMillis();
                NodeSet inNodes = input.toNodeSet();
                DocumentSet docs = inNodes.getDocumentSet();
                NGramIndexWorker index = (NGramIndexWorker) context.getBroker().getIndexController()
                    .getWorkerByIndexId(NGramIndex.ID);
                //Alternate design
                // NGramIndexWorker index =
                // (NGramIndexWorker)context.getBroker().getBrokerPool().getIndexManager().getIndexById(NGramIndex.ID).getWorker();
View Full Code Here

TOP

Related Classes of org.exist.indexing.ngram.NGramIndexWorker

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.