Package org.opensolaris.opengrok.analysis

Examples of org.opensolaris.opengrok.analysis.CompatibleAnalyser


                throw new IOException("Could not locate index database");
            }
            searcher = new IndexSearcher(ireader);
            SortField sfield = new SortField(QueryBuilder.DATE, SortField.Type.STRING, true);
            Sort sort = new Sort(sfield);
            QueryParser qparser = new QueryParser(QueryBuilder.PATH, new CompatibleAnalyser());
            Query query;
            ScoreDoc[] hits = null;
            try {
                query = qparser.parse(path);
                TopFieldDocs fdocs = searcher.search(query, null, hitsPerPage * cachePages, sort);
View Full Code Here


        if (redirect != null || errorMsg != null) {
            return this;
        }
        try {
            sourceContext = new Context(query, builder.getQueries());
            summerizer = new Summarizer(query, new CompatibleAnalyser());
        } catch (Exception e) {
            OpenGrokLogger.getLogger().log(Level.WARNING, "Summerizer: {0}", e.getMessage());
        }
        try {
            historyContext = new HistoryContext(query);
View Full Code Here

     * Create a query parser customized for OpenGrok.
     *
     * @param field default field for unqualified query terms
     */
    CustomQueryParser(String field) {
        super(field, new CompatibleAnalyser());
        setDefaultOperator(AND_OPERATOR);
        setAllowLeadingWildcard(
                RuntimeEnvironment.getInstance().isAllowLeadingWildcard());
        // Convert terms to lower case manually to prevent changing the case
        // if the field is case sensitive.
View Full Code Here

     * used to throw a StringIndexOutOfBoundsException. Bug #15858.
     */
    @Test
    public void bug15858() throws Exception {
        Query query = new QueryBuilder().setFreetext("beta").build();
        Summarizer instance = new Summarizer(query, new CompatibleAnalyser());
        // This call used to result in a StringIndexOutOfBoundsException
        assertNotNull(instance.getSummary("alpha beta gamma delta beta"));
    }
View Full Code Here

TOP

Related Classes of org.opensolaris.opengrok.analysis.CompatibleAnalyser

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.