Package org.apache.xindice.core.indexer

Examples of org.apache.xindice.core.indexer.Indexer


     * @param config The Indexer's configuration
     * @return The newly created Indexer
     */
    public final Indexer createIndexer(Configuration config) throws DBException {
        checkFiler(FaultCodes.COL_NO_INDEXMANAGER);
        Indexer idx = indexManager.create(config);
        getDatabase().flushConfig();
        return idx;
    }
View Full Code Here


            Collection col = getCollection((String) message.get(COLLECTION));
            if (col == null) {
                // No such collection
                result.put(RESULT, "no");
            } else {
                Indexer idx = col.getIndexer((String) message.get(NAME));
                if (idx != null) {
                    result.put(RESULT, "yes");
                } else {
                    result.put(RESULT, "no");
                }
View Full Code Here

                            }
                            ks.add(set.toArray(EMPTY_KEYS));
                        } else {
                            // 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(new IndexQueryANY(pattern));
                                Key[] keys = QueryEngine.getUniqueKeys(matches);
                                ks.add(keys);
                            }
                        }
                    }
View Full Code Here

                //       to do a collection scan in those cases where somebody
                //       typed an element or attribute name incorrectly.

                IndexPattern pattern = iq.getPattern();

                Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_NODEVALUE, pattern);
        if (idx != null) {
                    return new NamedKeys(nk.name, nk.attribute, QueryEngine.getUniqueKeys(idx.queryMatches(iq)));
                } else if (autoIndex) {
                    // TODO: This has to *not* be hardcoded
                    Element e = new DocumentImpl().createElement("index");
                    e.setAttribute("class", "org.apache.xindice.core.indexer.ValueIndexer");
                    e.setAttribute("name", "xp_" + ps);
View Full Code Here

                            }
                            ks.add(set.toArray(EMPTY_KEYS));
                        } else {
                            // 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(new IndexQueryANY(pattern));
                                Key[] keys = QueryEngine.getUniqueKeys(matches);
                                ks.add(keys);
                            }
                        }
                    }
View Full Code Here

                //       to do a collection scan in those cases where somebody
                //       typed an element or attribute name incorrectly.

                IndexPattern pattern = iq.getPattern();

                Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_NODEVALUE, pattern);
        if (idx != null) {
                    return new NamedKeys(nk.name, nk.attribute, QueryEngine.getUniqueKeys(idx.queryMatches(iq)));
                } else if (autoIndex) {
                    // TODO: This has to *not* be hardcoded
                    Element e = new DocumentImpl().createElement("index");
                    e.setAttribute("class", "org.apache.xindice.core.indexer.ValueIndexer");
                    e.setAttribute("name", "xp_" + ps);
View Full Code Here

        private Object queryTextIndex(String ps, String query) throws Exception {
            IndexPattern pattern = new IndexPattern(symbols, ps, nsMap);

            // check if there is full text indexer for this collection
            Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_FULLTEXT, pattern);
            if (idx instanceof LuceneIndexer) {
                LuceneIndexer textInd = ((LuceneIndexer) idx);
                analyzer = textInd.getAnalyzer();
                parameters.put(PARAM_ANALYZER, analyzer);
View Full Code Here

        }
    }

    private void deleteIndex(Collection col, String name, ServletOutputStream output) throws IOException, DBException {
        // delete indexer
        Indexer delIndex = col.getIndexer(name);
        if (delIndex != null) {
            if (col.dropIndexer(delIndex)) {
                output.println("<b>Indexer " + name + " deleted!</b>");
            } else {
                output.println("<b>Cannot delete Indexer " + name + "!</b>");
View Full Code Here

     * @return The newly created Indexer
     * @throws DBException if operation failed
     */
    public final Indexer createIndexer(Configuration config) throws DBException {
        checkFiler(FaultCodes.COL_NO_INDEXMANAGER);
        Indexer idx = indexManager.create(config);
        getDatabase().flushConfig();
        return idx;
    }
View Full Code Here

        // decide not to run optimization for the function
        Analyzer analyzer = (Analyzer) ctxt.getParameter(XPathQueryResolver.PARAM_ANALYZER);
        if (analyzer == null) {
            try {
                Collection collection = (Collection) ctxt.getParameter(XPathQueryResolver.PARAM_COLLECTION);
                Indexer idx = collection.getIndexManager().getBestIndexer(Indexer.STYLE_FULLTEXT, null);
                if (idx instanceof LuceneIndexer) {
                    analyzer = ((LuceneIndexer) idx).getAnalyzer();
                } else {
                    analyzer = (Analyzer) Class.forName(LuceneIndexer.DEFANALYZER).newInstance();
                }
View Full Code Here

TOP

Related Classes of org.apache.xindice.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.