Examples of SearchIndex


Examples of hudson.search.SearchIndex

        // now make the actual call to index items
        view.addDisplayNamesToSearchIndex(sib, items);

        // make and index with sib
        SearchIndex index = sib.make();
       
        // now make sure we can fetch item1 from the index
        List<SearchItem> result = new ArrayList<SearchItem>();
        index.find(displayName1, result);
        Assert.assertEquals(1, result.size());
        SearchItem actual = result.get(0);
        Assert.assertEquals(actual.getSearchName(), item1.getDisplayName());
        Assert.assertEquals(actual.getSearchUrl(), item1.getSearchUrl());

        // clear the result array for the next search result to test
        result.clear();
        // make sure we can fetch item 2 from the index
        index.find(displayName2, result);
        Assert.assertEquals(1, result.size());
        actual = result.get(0);
        Assert.assertEquals(actual.getSearchName(), item2.getDisplayName());
        Assert.assertEquals(actual.getSearchUrl(), item2.getSearchUrl());
    }
View Full Code Here

Examples of hudson.search.SearchIndex

        return true;
    }

    @Override
    protected SearchIndexBuilder makeSearchIndex() {
        return super.makeSearchIndex().add(new SearchIndex() {
            public void find(String token, List<SearchItem> result) {
                try {
                    if (token.startsWith("#"))
                        token = token.substring(1); // ignore leading '#'
                    int n = Integer.parseInt(token);
View Full Code Here

Examples of hudson.search.SearchIndex

            .getValue();
    }

    @Override
    protected SearchIndexBuilder makeSearchIndex() {
        return super.makeSearchIndex().add(new SearchIndex() {
            public void find(String token, List<SearchItem> result) {
                try {
                    if (token.startsWith("#"))
                        token = token.substring(1); // ignore leading '#'
                    int n = Integer.parseInt(token);
View Full Code Here

Examples of lius.search.SearchIndex

public class TestUtils {

  public static void main(String[] args) throws IOException {

    SearchIndex si = new SearchIndex();

    String sep = File.separator;

    StringTokenizer st = new StringTokenizer(System.getProperty(
View Full Code Here

Examples of net.sourceforge.pebble.index.SearchIndex

    pluginProperties = new PluginProperties(this);
    blogCompanion = new BlogCompanion(this);
    years = new ArrayList<Year>();

    // create the various indexes for this blog
    searchIndex = new SearchIndex(this);
    blogEntryIndex = new BlogEntryIndex(this);
    responseIndex = new ResponseIndex(this);
    tagIndex = new TagIndex(this);
    categoryIndex = new CategoryIndex(this);
    authorIndex = new AuthorIndex(this);
View Full Code Here

Examples of net.sourceforge.pebble.index.SearchIndex

    pluginProperties = new PluginProperties(this);
    blogCompanion = new BlogCompanion(this);
    years = new ArrayList<Year>();

    // create the various indexes for this blog
    searchIndex = new SearchIndex(this);
    blogEntryIndex = new BlogEntryIndex(this);
    responseIndex = new ResponseIndex(this);
    tagIndex = new TagIndex(this);
    categoryIndex = new CategoryIndex(this);
    authorIndex = new AuthorIndex(this);
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.SearchIndex

        QueryResult res = qm.createQuery(statement, JCR_SQL2).execute();
        checkResult(res, nodes);
    }

    protected void flushSearchIndex() throws RepositoryException {
        SearchIndex si = getSearchIndex();
        if (si != null) {
            si.flush();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.SearchIndex

        TestHelper.waitForTextExtractionTasksToFinish(session);
        flushSearchIndex();
    }

    protected void flushSearchIndex() throws RepositoryException {
        SearchIndex si = getSearchIndex();
        if (si != null) {
            si.flush();
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.SearchIndex

        final String workspaceName = session.getWorkspace().getName();
        QueryHandler qh = ri.getSearchManager(workspaceName).getQueryHandler();
        if (!(qh instanceof SearchIndex)) {
            throw new NotExecutableException("No search index");
        }
        SearchIndex si = (SearchIndex) qh;
        return si.runConsistencyCheck();
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.query.lucene.SearchIndex

    public void testResultSet() throws RepositoryException {
        createNodes(testRootNode, 10, 5, 0);
        superuser.save();

        SearchIndex index = getSearchIndex();
        int resultFetchSize = index.getResultFetchSize();
        try {
            String stmt = testPath + "//*[@" + jcrPrimaryType + "] order by @jcr:score descending";

            // with result fetch size Integer.MAX_VALUE
            readResult(executeQuery(stmt));

            // with result fetch size 100
            index.setResultFetchSize(100);
            readResult(executeQuery(stmt));

            // with 100 limit
            QueryImpl query = (QueryImpl) qm.createQuery(stmt, Query.XPATH);
            query.setLimit(100);
            readResult(query.execute());
        } finally {
            index.setResultFetchSize(resultFetchSize);
        }

        for (NodeIterator it = testRootNode.getNodes(); it.hasNext(); ) {
            it.nextNode().remove();
            superuser.save();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.