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
{ | |
"took": 3, | |
"timed_out": false, | |
"_shards": { | |
"total": 5, | |
"successful": 5, | |
"failed": 0 | |
}, | |
"hits": { | |
"total": 1, |
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
public class TermFreqQuerySample { | |
public static void main(String... args){ | |
Settings settings = ImmutableSettings.settingsBuilder().put("cluster.name","test-es-cluster").build(); | |
Client client = new TransportClient(settings) | |
.addTransportAddress(new InetSocketTransportAddress("192.168.30.114",9300)); | |
QueryBuilder query = QueryBuilders.queryString("java") | |
.defaultField("text"); |
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
######## Marvel ########## | |
marvel.agent.enabled: false |
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
curl -XPUT "http://localhost:9200/wildcard_sample" | |
curl -XPOST "http://localhost:9200/wildcard_sample/users/_mapping" -d' | |
{ | |
"users": { | |
"properties": { | |
"User_Name": { | |
"type": "multi_field", | |
"fields": { | |
"User_Name": { |
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
<fieldType name="text_ja_synonym" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="false"> | |
<analyzer> | |
<tokenizer class="solr.JapaneseTokenizerFactory" mode="search" /> | |
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" tokenizerFactory="solr.JapaneseTokenizerFactory"/> | |
</analyzer> | |
</fieldType> |
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
## Versions of Major Components | |
* Apache Tika 1.4 | |
* Carrot2 3.8.0 | |
* Velocity 1.7 and Velocity Tools 2.0 | |
* Apache UIMA 2.3.1 | |
* Apache ZooKeeper 3.4.5 | |
## Upgrading from Solr 4.5.0 |
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
# create index | |
curl -XPUT "http://localhost:9200/restful" | |
# post mapping | |
curl -XPOST "http://localhost:9200/restful/events/_mapping" -d' | |
{ | |
"events" : { | |
"dynamic_templates" : [ { | |
"template_string" : { | |
"mapping" : { |
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
# index作成 | |
curl -XPUT localhost:9200/hoge | |
# mappingの指定 | |
curl -XPUT localhost:9200/hoge/fuga/_mapping -d '{ | |
"fuga" : { | |
"numeric_detection" : false, | |
"properties" : { | |
"Resp_Time" : {"type" : "double"} | |
} | |
} |
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
クエリ | |
curl -XPOST "http://localhost:9200/numeric_test/hoge/_search" -d' | |
{ | |
"query": { | |
"bool": { | |
"should": [ | |
{ | |
"wildcard": { | |
"fuga": { | |
"value": "1?" |
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
curl -XPOST "http://httpbin.org/post" -d' | |
{ | |
"script_fields": { | |
"correctYear": { | |
"script": "doc['year'].value - 1800" | |
} | |
}, | |
"query": { | |
"term": { | |
"title": "crime" |