This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2011-01-21 00:20:48,468 [elasticsearch[Smuggler II]clusterService#updateTask-pool-6-thread-1] ERROR org.elasticsearch.gateway - [Smuggler II] failed to create index [twindexreal] | |
org.elasticsearch.common.inject.CreationException: Guice creation errors: | |
1) No implementation for java.util.Map<java.lang.String, org.elasticsearch.index.analysis.AnalyzerProviderFactory> was bound. | |
while locating java.util.Map<java.lang.String, org.elasticsearch.index.analysis.AnalyzerProviderFactory> | |
for parameter 2 at org.elasticsearch.index.analysis.AnalysisService.<init>(AnalysisService.java:59) | |
while locating org.elasticsearch.index.analysis.AnalysisService | |
for parameter 3 at org.elasticsearch.index.mapper.MapperService.<init>(MapperService.java:89) | |
at org.elasticsearch.index.mapper.MapperServiceModule.configure(MapperServiceModule.java:30) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.jetwick.es; | |
import org.apache.lucene.analysis.CharArraySet; | |
import org.apache.lucene.analysis.TokenStream; | |
import de.jetwick.org.apache.solr.analysis.WordDelimiterFilter; | |
import org.elasticsearch.common.settings.Settings; | |
import org.elasticsearch.index.Index; | |
import org.elasticsearch.index.analysis.AbstractTokenFilterFactory; | |
public class JetwickFilterFactory extends AbstractTokenFilterFactory { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (String fromIndex : indexList) { | |
SearchResponse rsp = client.prepareSearch(fromIndex). | |
setQuery(QueryBuilders.matchAllQuery()).setSize(hitsPerPage). | |
// This is important: | |
setSearchType(SearchType.QUERY_AND_FETCH). | |
setScroll(TimeValue.timeValueMinutes(30)).execute().actionGet(); | |
try { | |
long total = rsp.hits().totalHits(); | |
Collection<MyTweet> tweets = collectTweets(rsp); | |
bulkUpdate(tweets, intoIndex); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.elasticsearch.search.SearchHit; | |
import org.elasticsearch.search.SearchHits; | |
import java.util.Collection; | |
import org.elasticsearch.action.search.SearchResponse; | |
import org.elasticsearch.action.search.SearchType; | |
import org.elasticsearch.common.unit.TimeValue; | |
import java.util.LinkedHashMap; | |
import java.util.Map.Entry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this GIST is used for this ticket: https://gist.github.com/819239 | |
// SOLVED when sort against id ! | |
package org.elasticsearch.test.integration.search.scroll; | |
import org.elasticsearch.action.WriteConsistencyLevel; | |
import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; | |
import org.elasticsearch.action.bulk.BulkResponse; | |
import org.elasticsearch.action.count.CountResponse; | |
import org.elasticsearch.action.search.SearchResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.elasticsearch.transport.RemoteTransportException: [Fer-de-Lance][inet[/127.0.0.1:9300]][indices/search] | |
Caused by: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], total failure; shardFailures {[VHXZa25OQGCtSDa9zdUyFQ][twindex][0]: QueryPhaseExecutionException[[twindex][0]: query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@7ed467ba)],from[0],size[15],sort[<custom:"relevance": org.elasticsearch.index.field.data.doubles.DoubleFieldDataType$1@1afc83a>!]: Query Failed [Failed to execute main query]]; nested: }{[VHXZa25OQGCtSDa9zdUyFQ][twindex][3]: QueryPhaseExecutionException[[twindex][3]: query[ConstantScore(org.elasticsearch.common.lucene.search.AndFilter@7ed467ba)],from[0],size[15],sort[<custom:"relevance": org.elasticsearch.index.field.data.doubles.DoubleFieldDataType$1@1afc83a>!]: Query Failed [Failed to execute main query]]; nested: } | |
... | |
at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we don't want results with an id larger than maxId | |
long maxId = lastId; | |
// we don't want results with an id smaller than sinceId | |
long sinceId = lastId; | |
int hitsPerPage = 100; | |
int maxPages = 1; | |
boolean breakPaging = false; | |
for (int page = 0; page < maxPages; page++) { | |
Query query = new Query(term); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a document with a number -> faceting over that | |
ComparatorType.TOTAL | |
==================== | |
term:9 count:2 total:2.0 | |
there should be 10 terms. there were:1 | |
ComparatorType.COUNT | |
==================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test public void testTermsStatsFacetsShouldAllowFilter() throws Exception { | |
try { | |
client.admin().indices().prepareDelete("test").execute().actionGet(); | |
} catch (Exception e) { | |
// ignore | |
} | |
client.admin().indices().prepareCreate("test").execute().actionGet(); | |
client.admin().cluster().prepareHealth().setWaitForGreenStatus().execute().actionGet(); | |
for (int i = 0; i < 20; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test public void testSimpleScroll3() throws Exception { | |
try { | |
client.admin().indices().prepareDelete("test1").execute().actionGet(); | |
client.admin().indices().prepareDelete("test2").execute().actionGet(); | |
client.admin().indices().prepareDelete("unrelatedindex").execute().actionGet(); | |
} catch (Exception e) { | |
// ignore | |
} | |
client.admin().indices().prepareCreate("test1").setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", 2)) |
OlderNewer