Examples of suggest()


Examples of com.flaptor.hounder.searcher.query.WordQuerySuggestor.suggest()

        FSDirectory origDir = FSDirectory.getDirectory(tmpDir + File.separator + "indexer" + File.separator + "indexes" + File.separator + "index");
        FSDirectory spellDir = FSDirectory.getDirectory(tmpDir + File.separator + "spell");
        new DidYouMeanIndexer().createSpellIndex("content".intern(), origDir, spellDir);
        WordQuerySuggestor suggestor = new WordQuerySuggestor(spellDir.getFile());

        assertNotNull(suggestor.suggest(new LazyParsedQuery("content")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contenta")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contetb")));

        Config searcherConfig = Config.getConfig("searcher.properties");
        searcherConfig.set("compositeSearcher.useSpellCheckSuggestQuery", "true");
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.WordQuerySuggestor.suggest()

        FSDirectory spellDir = FSDirectory.getDirectory(tmpDir + File.separator + "spell");
        new DidYouMeanIndexer().createSpellIndex("content".intern(), origDir, spellDir);
        WordQuerySuggestor suggestor = new WordQuerySuggestor(spellDir.getFile());

        assertNotNull(suggestor.suggest(new LazyParsedQuery("content")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contenta")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contetb")));

        Config searcherConfig = Config.getConfig("searcher.properties");
        searcherConfig.set("compositeSearcher.useSpellCheckSuggestQuery", "true");
        searcherConfig.set("searcher.suggestQuerySearcher.dictionaryDir", spellDir.getFile().getAbsolutePath());
View Full Code Here

Examples of com.flaptor.hounder.searcher.query.WordQuerySuggestor.suggest()

        new DidYouMeanIndexer().createSpellIndex("content".intern(), origDir, spellDir);
        WordQuerySuggestor suggestor = new WordQuerySuggestor(spellDir.getFile());

        assertNotNull(suggestor.suggest(new LazyParsedQuery("content")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contenta")));
        assertNotNull(suggestor.suggest(new LazyParsedQuery("contetb")));

        Config searcherConfig = Config.getConfig("searcher.properties");
        searcherConfig.set("compositeSearcher.useSpellCheckSuggestQuery", "true");
        searcherConfig.set("searcher.suggestQuerySearcher.dictionaryDir", spellDir.getFile().getAbsolutePath());
        searcher = new CompositeSearcher();
View Full Code Here

Examples of de.spinscale.elasticsearch.service.suggest.ShardSuggestService.suggest()

    @Override
    protected ShardSuggestResponse shardOperation(ShardSuggestRequest request) throws ElasticsearchException {
        logger.trace("Entered TransportSuggestAction.shardOperation()");
        IndexService indexService = indicesService.indexServiceSafe(request.index());
        ShardSuggestService suggestShardService = indexService.shardInjectorSafe(request.shardId()).getInstance(ShardSuggestService.class);
        return suggestShardService.suggest(request);
    }

    @Override
    protected GroupShardsIterator shards(ClusterState clusterState,
            SuggestRequest request, String[] concreteIndices) {
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.stats.IndicesStatsRequest.suggest()

            indicesStatsRequest.idCache(metrics.contains("id_cache"));
            indicesStatsRequest.percolate(metrics.contains("percolate"));
            indicesStatsRequest.segments(metrics.contains("segments"));
            indicesStatsRequest.fieldData(metrics.contains("fielddata"));
            indicesStatsRequest.completion(metrics.contains("completion"));
            indicesStatsRequest.suggest(metrics.contains("suggest"));
            indicesStatsRequest.queryCache(metrics.contains("query_cache"));
        }

        if (request.hasParam("groups")) {
            indicesStatsRequest.groups(Strings.splitStringByCommaToArray(request.param("groups")));
View Full Code Here

Examples of org.elasticsearch.action.suggest.SuggestRequest.suggest()

    protected SuggestRequest request() {
        SuggestRequest suggestRequest = super.request();
        try {
            XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE);
            suggest.toXContent(builder, ToXContent.EMPTY_PARAMS);
            suggestRequest.suggest(builder.bytes());
        } catch (IOException e) {
            throw new ElasticSearchException("Unable to build suggestion request", e);
        }
        return suggestRequest;
    }
View Full Code Here

Examples of org.elasticsearch.action.suggest.SuggestRequest.suggest()

    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        SuggestRequest suggestRequest = new SuggestRequest(Strings.splitStringByCommaToArray(request.param("index")));
        suggestRequest.indicesOptions(IndicesOptions.fromRequest(request, suggestRequest.indicesOptions()));
        suggestRequest.listenerThreaded(false);
        if (request.hasContent()) {
            suggestRequest.suggest(request.content(), request.contentUnsafe());
        } else {
            String source = request.param("source");
            if (source != null) {
                suggestRequest.suggest(source);
            } else {
View Full Code Here

Examples of org.elasticsearch.action.suggest.SuggestRequest.suggest()

        if (request.hasContent()) {
            suggestRequest.suggest(request.content(), request.contentUnsafe());
        } else {
            String source = request.param("source");
            if (source != null) {
                suggestRequest.suggest(source);
            } else {
                throw new ElasticsearchIllegalArgumentException("no content or source provided to execute suggestion");
            }
        }
        suggestRequest.routing(request.param("routing"));
View Full Code Here

Examples of org.elasticsearch.search.builder.SearchSourceBuilder.suggest()

            int suggestSize = request.paramAsInt("suggest_size", 5);
            if (searchSourceBuilder == null) {
                searchSourceBuilder = new SearchSourceBuilder();
            }
            String suggestMode = request.param("suggest_mode");
            searchSourceBuilder.suggest().addSuggestion(
                    termSuggestion(suggestField).field(suggestField).text(suggestText).size(suggestSize)
                            .suggestMode(suggestMode)
            );
        }
View Full Code Here

Examples of org.raml.parser.visitor.YamlDocumentSuggester.suggest()

    @Test
    public void emptyRaml()
    {
        YamlDocumentSuggester yamlDocumentSuggester = new YamlDocumentSuggester(new RamlDocumentBuilder());
        List<Suggestion> suggest = yamlDocumentSuggester.suggest("", "");
        assertThat(suggest.size(), is(1));
        assertThat(suggest.contains(new DefaultSuggestion(VERSION)), is(true));
        assertThat(suggest.get(0).getIndentation(), is(0));
    }
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.